/* ============================================================
   WoodMax Admin Panel - CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-w: 260px;
  --header-h: 64px;
  --primary: #8B4513;
  --primary-dark: #5C2E0A;
  --primary-light: #C4752A;
  --accent: #D4AF37;
  --dark: #1A0F08;
  --mid: #4A2C17;
  --warm: #F5E6D3;
  --warm2: #FAF3E8;
  --white: #FFFFFF;
  --gray: #6B7280;
  --border: #E5D5C8;
  --success: #16A34A;
  --danger: #DC2626;
  --warning: #D97706;
  --info: #2563EB;
  --shadow: 0 4px 24px rgba(139,69,19,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: #F7EFEA;
  color: var(--dark);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ============ LAYOUT ============ */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--dark) 0%, var(--primary-dark) 100%);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: all 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.sidebar-logo {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--white);
  line-height: 1;
}

.sidebar-logo .logo-text span {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.sidebar-nav { padding: 16px 0; }

.nav-section {
  padding: 0 16px;
  margin-bottom: 6px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 10px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.72);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 2px;
  position: relative;
}

.nav-item .nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255,255,255,0.07);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  background: var(--primary);
}

.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--dark);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ TOP HEADER ============ */
.top-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 12px rgba(139,69,19,0.08);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title { font-size: 20px; font-family: 'Playfair Display', serif; color: var(--dark); }
.page-subtitle { font-size: 12px; color: var(--gray); }

.header-right { display: flex; align-items: center; gap: 12px; }

.header-btn {
  width: 38px;
  height: 38px;
  background: var(--warm2);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--gray);
  transition: all 0.2s ease;
  position: relative;
}

.header-btn:hover { background: var(--warm); color: var(--primary); }

.header-notif {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--warm2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-profile:hover { background: var(--warm); }

.admin-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.admin-info { line-height: 1.2; }
.admin-info .name { font-size: 13px; font-weight: 600; color: var(--dark); }
.admin-info .role { font-size: 11px; color: var(--gray); }

/* ============ PAGE CONTENT ============ */
.page-content { padding: 28px; flex: 1; }

/* ============ STATS CARDS ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.orange::before { background: var(--primary); }
.stat-card.green::before  { background: var(--success); }
.stat-card.blue::before   { background: var(--info); }
.stat-card.gold::before   { background: var(--accent); }

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(139,69,19,0.18); }

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.orange { background: #FEF3C7; color: var(--primary); }
.stat-icon.green  { background: #D1FAE5; color: var(--success); }
.stat-icon.blue   { background: #DBEAFE; color: var(--info); }
.stat-icon.gold   { background: #FEF9C3; color: var(--warning); }

.stat-info .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  font-family: 'Playfair Display', serif;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-info .label { font-size: 13px; color: var(--gray); }

.stat-info .change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.change.up   { color: var(--success); }
.change.down { color: var(--danger); }

/* ============ CONTENT PANELS ============ */
.panel {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title { font-size: 16px; font-weight: 600; color: var(--dark); }
.panel-subtitle { font-size: 12px; color: var(--gray); margin-top: 2px; }

.panel-body { padding: 24px; }

/* ============ ADMIN TABLES ============ */
.admin-table { width: 100%; border-collapse: collapse; }

.admin-table thead th {
  background: var(--warm2);
  color: var(--mid);
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.admin-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid #F7EDEA;
  font-size: 13.5px;
  vertical-align: middle;
}

.admin-table tbody tr:hover { background: var(--warm2); }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* ============ ACTION BUTTONS ============ */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.action-btn.view  { border-color: var(--info); color: var(--info); }
.action-btn.edit  { border-color: var(--warning); color: var(--warning); }
.action-btn.delete{ border-color: var(--danger); color: var(--danger); }
.action-btn.reply { border-color: var(--success); color: var(--success); }

.action-btn.view:hover  { background: var(--info); color: var(--white); }
.action-btn.edit:hover  { background: var(--warning); color: var(--white); }
.action-btn.delete:hover{ background: var(--danger); color: var(--white); }
.action-btn.reply:hover { background: var(--success); color: var(--white); }

/* ============ FORMS ============ */
.admin-form .form-group { margin-bottom: 20px; }

.admin-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 7px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--dark);
  transition: all 0.2s ease;
  outline: none;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,69,19,0.1);
}

.admin-form textarea { resize: vertical; min-height: 100px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ============ IMAGE UPLOAD ============ */
.img-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--warm2);
}

.img-upload-zone:hover { border-color: var(--primary); background: var(--warm); }
.img-upload-zone .icon { font-size: 40px; color: var(--gray); margin-bottom: 10px; }
.img-upload-zone p { font-size: 14px; color: var(--gray); }
.img-upload-zone input { display: none; }

.img-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 14px;
  display: none;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-accent  { background: var(--accent); color: var(--dark); }
.btn-accent:hover { background: #C4A030; color: var(--dark); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger  { background: var(--danger); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 13px 30px; font-size: 15px; }

/* ============ ALERTS ============ */
.alert {
  padding: 13px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid;
}

.alert-success { background: #F0FDF4; color: #166534; border-color: var(--success); }
.alert-danger  { background: #FEF2F2; color: #991B1B; border-color: var(--danger); }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: var(--warning); }
.alert-info    { background: #EFF6FF; color: #1E40AF; border-color: var(--info); }

/* ============ STATUS BADGES ============ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-pending    { background: #FEF3C7; color: #92400E; }
.badge-confirmed  { background: #DBEAFE; color: #1E40AF; }
.badge-processing { background: #E0E7FF; color: #3730A3; }
.badge-shipped    { background: #D1FAE5; color: #065F46; }
.badge-delivered  { background: #DCFCE7; color: #14532D; }
.badge-cancelled  { background: #FEE2E2; color: #991B1B; }
.badge-new        { background: #FEF3C7; color: #92400E; }
.badge-read       { background: #DBEAFE; color: #1E40AF; }
.badge-replied    { background: #D1FAE5; color: #065F46; }
.badge-closed     { background: #F3F4F6; color: #6B7280; }
.badge-active     { background: #DCFCE7; color: #14532D; }
.badge-inactive   { background: #FEE2E2; color: #991B1B; }
.badge-paid       { background: #D1FAE5; color: #065F46; }
.badge-failed     { background: #FEE2E2; color: #991B1B; }
.badge-super_admin{ background: #FEF9C3; color: #854D0E; }
.badge-admin      { background: #E0E7FF; color: #3730A3; }
.badge-manager    { background: #D1FAE5; color: #065F46; }

/* ============ PRODUCT IMAGE ============ */
.product-img-sm {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border);
}

/* ============ PAGINATION ============ */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 20px;
}

.page-btn {
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--dark);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.page-btn:hover, .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  transform: scale(0.95);
  transition: all 0.2s ease;
}

.modal-overlay.active .modal { transform: scale(1); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 18px; font-weight: 600; color: var(--dark); }

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--warm2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--danger); color: var(--white); }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============ DASHBOARD CHARTS ============ */
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .sidebar { width: 70px; }
  .sidebar-logo .logo-text,
  .nav-item span,
  .nav-badge,
  .nav-section-title { display: none; }
  .main-content { margin-left: 70px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-3 { margin-top: 24px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
