/* ============================================
   Gen-y Kids — Admin Panel Styles
   ============================================ */

:root {
  --coral: #FF6B6B;
  --coral-dark: #E55A5A;
  --teal: #4ECDC4;
  --teal-dark: #3DBDB5;
  --yellow: #FFE66D;
  --purple: #A78BFA;
  --sky: #60A5FA;
  --white: #FFFFFF;
  --bg: #F3F4F6;
  --bg-alt: #E5E7EB;
  --text: #1F2937;
  --text-light: #6B7280;
  --text-lighter: #9CA3AF;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Fredoka One', 'Nunito', sans-serif;
  --sidebar-width: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
table { width: 100%; border-collapse: collapse; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-alt); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-lighter); }

/* ---------- Login Screen ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 50%, #A78BFA 100%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.logo-icon { font-size: 32px; }
.logo-text {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--text);
}
.logo-accent {
  background: linear-gradient(135deg, var(--coral), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-card h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  margin-bottom: 8px;
}
.login-card > p { color: var(--text-light); font-size: 14px; margin-bottom: 24px; }
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  text-align: left;
}
.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  background: var(--white);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(78,205,196,0.1);
}
.password-input { position: relative; }
.password-input input { padding-right: 44px; }
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.login-error {
  display: block;
  color: var(--coral);
  font-size: 13px;
  font-weight: 600;
  min-height: 20px;
}
.back-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-light);
  transition: var(--transition);
}
.back-link:hover { color: var(--coral); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--coral);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--coral-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--coral); color: var(--coral); }
.btn-danger {
  background: #EF4444;
  color: var(--white);
}
.btn-danger:hover { background: #DC2626; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- Admin App Layout ---------- */
.admin-app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-close { display: none; font-size: 20px; margin-left: auto; color: var(--text-light); }
.sidebar-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  transition: var(--transition);
  text-align: left;
  width: 100%;
}
.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.active {
  background: linear-gradient(135deg, rgba(255,107,107,0.1), rgba(78,205,196,0.1));
  color: var(--coral);
}
.nav-icon { font-size: 18px; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-link {
  font-size: 13px;
  color: var(--text-light);
  transition: var(--transition);
  font-weight: 600;
}
.sidebar-link:hover { color: var(--coral); }
.logout-btn { text-align: left; }

/* ---------- Main Content ---------- */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.hamburger-admin {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 24px;
}
.hamburger-admin span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}
.admin-topbar h1 { font-size: 20px; font-weight: 800; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-user { font-size: 13px; font-weight: 600; color: var(--text-light); }

/* ---------- Sections ---------- */
.admin-section {
  display: none;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
.admin-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-value { font-size: 24px; font-weight: 800; display: block; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-light); font-weight: 600; }

/* ---------- Dashboard Cards ---------- */
.dashboard-cards {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.dash-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.dash-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dash-table-wrapper { overflow-x: auto; }
.dash-table { font-size: 13px; }
.dash-table th { text-align: left; padding: 8px 12px; color: var(--text-light); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.dash-table td { padding: 10px 12px; border-top: 1px solid var(--border-light); }
.quick-stats { display: flex; flex-direction: column; gap: 12px; }
.quick-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
}
.quick-stat-item span { font-size: 13px; color: var(--text-light); }
.quick-stat-item strong { font-size: 15px; color: var(--text); }

/* ---------- Section Header Bar ---------- */
.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-header-left h2 { font-size: 20px; font-weight: 800; }
.item-count { font-size: 13px; color: var(--text-lighter); font-weight: 600; }
.filter-select {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* ---------- Product Form ---------- */
.product-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.product-form-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 20px; }
.form-actions { display: flex; gap: 12px; margin-top: 16px; }

/* ---------- Data Tables ---------- */
.table-wrapper {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.data-table { font-size: 14px; }
.data-table thead { background: var(--bg); }
.data-table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #FAFAFA; }
.data-table .product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.data-table .product-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.data-table .product-name { font-weight: 700; }
.badge-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.badge-sale { background: rgba(255,107,107,0.1); color: var(--coral); }
.badge-new { background: rgba(78,205,196,0.1); color: var(--teal); }
.badge-bestseller { background: rgba(167,139,250,0.1); color: var(--purple); }
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.status-pending { background: #FEF3C7; color: #D97706; }
.status-shipped { background: #DBEAFE; color: #2563EB; }
.status-delivered { background: #D1FAE5; color: #059669; }
.action-btns { display: flex; gap: 6px; }
.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
  background: var(--bg);
}
.action-btn:hover { background: var(--border); }
.action-btn.delete:hover { background: #FEE2E2; }

/* ---------- Settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.settings-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dev-note {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.6;
}
.dev-note a { color: var(--teal); }

/* Image Upload */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.image-upload-area:hover { border-color: var(--teal); background: rgba(78,205,196,0.03); }
.upload-placeholder span { font-size: 32px; display: block; margin-bottom: 8px; }
.upload-placeholder p { font-size: 13px; color: var(--text-light); }

/* Data Actions */
.data-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state span { font-size: 48px; display: block; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-light); font-size: 14px; }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--teal);
}
.toast.toast-error { border-left-color: #EF4444; }
.toast.toast-success { border-left-color: #059669; }
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 20px; }
.toast-message { flex: 1; font-size: 13px; font-weight: 600; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(40px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-cards { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .sidebar-close { display: block; }
  .hamburger-admin { display: flex; }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .admin-section { padding: 16px; }
  .section-header-bar { flex-direction: column; align-items: flex-start; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 8px; }
  .login-card { padding: 32px 24px; }
}
