/* -------------------------------------------------------------
   AACHAR ADMIN PANEL - Stylesheet (Shweta Fabrics Architecture)
   ------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --admin-bg: #F4F6F8;
  --admin-sidebar: #112816;
  --admin-sidebar-hover: #1E3F20;
  --admin-accent: #C85A17;
  --admin-gold: #D4AF37;
  --admin-card: #FFFFFF;
  --admin-text: #1F2421;
  --admin-muted: #637381;
  --admin-border: #E5E8EC;
  --admin-success: #22C55E;
  --admin-warning: #F59E0B;
  --admin-danger: #EF4444;
  --admin-info: #3B82F6;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

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

.admin-logo-img {
  height: 44px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.admin-brand-sub {
  font-size: 0.72rem;
  color: var(--admin-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.menu-item button {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #919EAB;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-item button:hover,
.menu-item button.active {
  background: var(--admin-sidebar-hover);
  color: #fff;
}

.menu-item button.active {
  border-left: 4px solid var(--admin-accent);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.store-preview-btn {
  width: 100%;
  background: rgba(212, 175, 55, 0.15);
  color: var(--admin-gold);
  border: 1px solid var(--admin-gold);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.store-preview-btn:hover {
  background: var(--admin-gold);
  color: var(--admin-sidebar);
}

/* Main Content Area */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Navbar */
.top-nav {
  background: var(--admin-card);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-header-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--admin-text);
}

.admin-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--admin-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Content Container */
.content-body {
  padding: 32px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dashboard Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--admin-card);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--admin-sidebar);
  margin-top: 4px;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.green {
  background: #DCFCE7;
  color: var(--admin-success);
}

.stat-icon.orange {
  background: #FFEDD5;
  color: var(--admin-accent);
}

.stat-icon.blue {
  background: #DBEAFE;
  color: var(--admin-info);
}

.stat-icon.gold {
  background: #FEF3C7;
  color: #D97706;
}

/* Admin Data Tables */
.card-table-wrapper {
  background: var(--admin-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


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

.table-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-add {
  background: var(--admin-sidebar);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-add:hover {
  background: var(--admin-sidebar-hover);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--admin-bg);
  padding: 14px 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
}

.data-table td {
  padding: 16px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--admin-border);
}

.data-table tr:hover td {
  background: rgba(244, 246, 248, 0.5);
}

/* Status Badges */
.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.badge-pending {
  background: #FEF3C7;
  color: #D97706;
}

.badge-processing {
  background: #DBEAFE;
  color: #2563EB;
}

.badge-dispatched {
  background: #E0E7FF;
  color: #4F46E5;
}

.badge-delivered {
  background: #DCFCE7;
  color: #16A34A;
}

.badge-cancelled {
  background: #FEE2E2;
  color: #DC2626;
}

.action-btn-group {
  display: flex;
  gap: 8px;
}

.btn-sm-action {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--admin-border);
  background: var(--admin-bg);
  color: var(--admin-text);
  cursor: pointer;
}

.btn-sm-action:hover {
  background: var(--admin-sidebar);
  color: #fff;
}

.btn-danger {
  background: var(--admin-danger);
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #DC2626;
}

/* --- CUSTOM ADMIN DROPDOWNS & SELECT ENGINE --- */
select,
.admin-select,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 8px 36px 8px 12px;
  border-radius: 8px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231B3B22' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  border: 1px solid var(--admin-border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-text);
  outline: none;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

select:hover, select:focus,
.admin-select:hover, .admin-select:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(200, 90, 23, 0.12);
}

select option {
  background: #ffffff;
  color: var(--admin-text);
  padding: 8px;
}

/* Mobile Sidebar Toggle & Drawer Overlay */
.mobile-sidebar-toggle {
  display: none;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--admin-sidebar);
  cursor: pointer;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 95;
  display: none;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.active {
  display: block;
}

/* --- ADMIN RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 992px) {
  .mobile-sidebar-toggle {
    display: flex;
  }

  .sidebar {
    left: -260px;
    transition: transform 0.3s ease;
    z-index: 100;
  }

  .sidebar.active {
    transform: translateX(260px);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .top-nav {
    padding: 14px 20px;
  }

  .content-body {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .table-header-action {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-table-wrapper {
    padding: 16px;
  }

  .page-header-title {
    font-size: 1.2rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th, .data-table td {
    padding: 10px 8px;
  }
}