/* ==========================================================================
   Angadi Mart — Admin Control Center Stylesheet
   Responsive administrative portal for store management
   ========================================================================== */

:root {
  --admin-sidebar-w: 260px;
  --admin-bg: #F4F6F8;
  --admin-card-bg: #FFFFFF;
  --admin-primary: #2D5A27;
  --admin-accent: #CB4727;
  --admin-text-main: #1C252C;
  --admin-text-muted: #637381;
  --admin-border: #DFE3E8;
}

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

/* Sidebar */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: #182216;
  color: #D3DDCF;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 1.5rem 1.2rem;
  transition: transform 0.3s ease;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #2B3D28;
  margin-bottom: 1.5rem;
}

.admin-sidebar-brand h2 {
  font-size: 1.2rem;
  color: #FFFDF7;
}

.admin-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #B2C4AC;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: var(--admin-primary);
  color: #FFFFFF;
}

.admin-bottom-actions {
  border-top: 1px solid #2B3D28;
  padding-top: 1.2rem;
}

/* Main Admin Layout */
.admin-main-wrap {
  margin-left: var(--admin-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Admin Header */
.admin-top-header {
  height: 70px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.admin-page-title h1 {
  font-size: 1.4rem;
  color: var(--admin-text-main);
}

.admin-user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

/* Content Area */
.admin-content {
  padding: 2rem;
  flex: 1;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-text-muted);
  text-transform: uppercase;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(45, 90, 39, 0.1);
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--admin-text-main);
}

/* Section Containers */
.admin-panel-card {
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  margin-bottom: 2rem;
  overflow: hidden;
}

.panel-header {
  padding: 1.2rem 1.8rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-header h3 {
  font-size: 1.2rem;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Data Tables */
.admin-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.admin-table th {
  background: #F9FAFB;
  padding: 0.9rem 1.4rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #F9FBF8;
}

/* Product Row Specifics */
.table-prod-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #F9FAFB;
  border-radius: 6px;
  padding: 3px;
  border: 1px solid var(--admin-border);
}

.badge-status {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge-status.active {
  background: #E6F4EA;
  color: #137333;
}

.badge-status.out-of-stock {
  background: #FCE8E6;
  color: #C5221F;
}

.badge-status.pending {
  background: #FEF7E0;
  color: #B06000;
}

.badge-status.packing {
  background: #E8F0FE;
  color: #1A73E8;
}

.badge-status.dispatched {
  background: #E6F4EA;
  color: #137333;
}

.badge-status.delivered {
  background: #CEEAD6;
  color: #0D652D;
}

/* Action Icons inside Tables */
.table-btn {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--admin-border);
  background: #FFFFFF;
}

.table-btn.edit:hover {
  background: var(--admin-primary);
  color: #FFFFFF;
}

.table-btn.delete:hover {
  background: #C5221F;
  color: #FFFFFF;
  border-color: #C5221F;
}

/* Status Selector dropdown inside orders table */
.order-status-select {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  font-weight: 700;
  font-size: 0.85rem;
  background: #FFFFFF;
  cursor: pointer;
}

/* Complaints & Categories Badges */
.badge-category {
  display: inline-block;
  background: #EBF3EA;
  color: #2D5A27;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-status.status-new {
  background: #FFF3C4;
  color: #D9480F;
}

.badge-status.status-under-review {
  background: #E7F5FF;
  color: #1971C2;
}

.badge-status.status-waiting-for-customer {
  background: #FFF9DB;
  color: #F59F00;
}

.badge-status.status-resolved {
  background: #EBFBEE;
  color: #2B8A3E;
}

.badge-status.status-closed {
  background: #F1F3F5;
  color: #495057;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main-wrap {
    margin-left: 0;
  }
}
