/* ===== RR HIJAB - Admin Panel Stylesheet ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #8B5E83;
  --primary-dark: #6B3F63;
  --primary-light: #C49ABB;
  --accent: #D4AF37;
  --bg: #F7F2FA;
  --white: #FFFFFF;
  --text: #2C2C2C;
  --text-light: #6B6B6B;
  --border: #E8D8F0;
  --success: #4CAF50;
  --danger: #E53935;
  --warning: #FF9800;
  --info: #2196F3;
  --sidebar-width: 260px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(139,94,131,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F5EEF8 0%, #E8D8F0 50%, #D4B8D8 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(139,94,131,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-circle {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin: 0 auto 16px;
  letter-spacing: 1px;
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.login-logo p {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  color: var(--text);
}

.form-control:focus { border-color: var(--primary); }

.form-control.input-icon { padding-left: 44px; }

.input-wrapper {
  position: relative;
}

.input-wrapper .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-light);
}

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s;
  margin-top: 8px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,94,131,0.35);
}

.login-error {
  background: #FFEBEE;
  border: 1px solid #FFCDD2;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-top: 16px;
  display: none;
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary-dark) 0%, #3D1A4A 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-sm {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.sidebar-logo .brand-name {
  font-size: 16px;
  font-weight: 700;
}

.sidebar-logo .brand-sub {
  font-size: 11px;
  opacity: 0.6;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.5;
  padding: 16px 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,0.18);
  color: white;
}

.nav-item .nav-icon { font-size: 18px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #333;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-user:hover { background: rgba(255,255,255,0.1); }

.user-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info .user-name { font-size: 13px; font-weight: 600; }
.user-info .user-role { font-size: 11px; opacity: 0.6; }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: rgba(229,57,53,0.15);
  color: #FF8A80;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-logout:hover { background: rgba(229,57,53,0.25); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOP BAR ===== */
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--text);
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.topbar-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

.topbar-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.topbar-btn.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 18px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.purple { background: #F5EEF8; }
.stat-icon.green { background: #E8F5E9; }
.stat-icon.orange { background: #FFF3E0; }
.stat-icon.blue { background: #E3F2FD; }

.stat-label { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-change { font-size: 12px; color: var(--success); margin-top: 2px; }

/* ===== DATA TABLE ===== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h3 { font-size: 16px; font-weight: 700; }

.card-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar input {
  padding: 8px 36px 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  width: 200px;
}

.search-bar input:focus { border-color: var(--primary); }
.search-bar .search-icon { position: absolute; right: 10px; color: var(--text-light); font-size: 14px; }

.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #F9F5FC;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

tr:hover td { background: #FDFAFF; }

.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm, 8px);
  background: var(--bg);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}

.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-active { background: #E8F5E9; color: var(--success); }
.badge-inactive { background: #FFEBEE; color: var(--danger); }
.badge-new { background: #E3F2FD; color: var(--info); }
.badge-sale { background: #FFF8E1; color: var(--warning); }

.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ===== PRODUCT FORM MODAL ===== */
.form-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.form-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.form-modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.92);
  transition: transform 0.3s;
}

.form-modal-overlay.open .form-modal { transform: scale(1); }

.form-modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-modal-header h3 { font-size: 18px; font-weight: 700; }

.btn-close-form {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-close-form:hover { background: var(--bg); }

.form-modal-body { padding: 24px 28px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { margin-bottom: 18px; }

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  color: var(--text);
  background: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6B6B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  transition: border-color 0.2s;
}

.form-select:focus { border-color: var(--primary); }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.image-upload-area:hover {
  border-color: var(--primary);
  background: #FDF8FF;
}

.image-upload-area .upload-icon { font-size: 36px; margin-bottom: 10px; }
.image-upload-area p { font-size: 13px; color: var(--text-light); }
.image-upload-area strong { color: var(--primary); }

.image-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  display: none;
}

.form-modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-cancel {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
}

.btn-cancel:hover { background: var(--bg); }

.btn-save {
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-save:hover { background: var(--primary-dark); }

/* ===== DELETE CONFIRM ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.confirm-overlay.open { opacity: 1; pointer-events: all; }

.confirm-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.confirm-overlay.open .confirm-box { transform: scale(1); }

.confirm-icon { font-size: 48px; margin-bottom: 16px; }
.confirm-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-box p { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }

.confirm-actions { display: flex; gap: 12px; justify-content: center; }

.btn-confirm-cancel {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
}

.btn-confirm-delete {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: var(--danger);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: background 0.2s;
}

.btn-confirm-delete:hover { background: #c62828; }

/* ===== TOAST ===== */
.admin-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-toast {
  background: white;
  border-left: 4px solid var(--success);
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: 500;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlide 0.3s ease;
}

.admin-toast.error { border-left-color: var(--danger); }
.admin-toast.warning { border-left-color: var(--warning); }

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--text-light); }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content { margin-left: 0; }
  .btn-sidebar-toggle { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}
