/* =========================================================
   Mithila Super Roots - Modern Admin Dashboard Stylesheet
   ========================================================= */

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

:root {
  --admin-primary: #1d4d38;
  --admin-sidebar-bg: #11281e;
  --admin-accent: #d49a37;
  --admin-bg: #f4f6f8;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-text-muted: #64748b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --admin-shadow: 0 4px 12px 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);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: #0f172a;
}

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

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-header h2 {
  color: #fff;
  font-size: 1.3rem;
}
.sidebar-header span {
  color: var(--admin-accent);
}

.sidebar-menu {
  list-style: none;
  padding: 20px 10px;
  flex-grow: 1;
}
.sidebar-menu li {
  margin-bottom: 6px;
}
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.2s ease;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: rgba(212, 154, 55, 0.15);
  color: #ffffff;
  border-left: 3px solid var(--admin-accent);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Main Content Area */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background: #ffffff;
  height: 70px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}
.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}
.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--admin-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.admin-content {
  padding: 30px;
  flex-grow: 1;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-info h3 {
  font-size: 1.8rem;
  margin-bottom: 4px;
  color: var(--admin-primary);
}
.stat-info p {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(29, 77, 56, 0.1);
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Admin Card & Data Tables */
.admin-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  overflow: hidden;
  margin-bottom: 30px;
}
.admin-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-header h3 {
  font-size: 1.15rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.admin-table th {
  background: #f8fafc;
  padding: 14px 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  border-bottom: 1px solid var(--admin-border);
}
.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.92rem;
  vertical-align: middle;
}
.admin-table tr:hover {
  background-color: #f8fafc;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #e0f2fe; color: #0369a1; }
.status-shipped { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }

/* Admin Buttons */
.btn-admin {
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}
.btn-admin:hover {
  transform: translateY(-1px);
}
.btn-admin-primary { 
  background: linear-gradient(135deg, var(--admin-primary) 0%, #123325 100%); 
  color: #fff; 
  box-shadow: 0 4px 10px rgba(29, 77, 56, 0.25);
}
.btn-admin-primary:hover { 
  background: linear-gradient(135deg, #245e45 0%, #0d261b 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(29, 77, 56, 0.35);
}
.btn-admin-accent { 
  background: linear-gradient(135deg, #d49a37 0%, #b87d20 100%); 
  color: #fff; 
  box-shadow: 0 4px 12px rgba(212, 154, 55, 0.3);
}
.btn-admin-accent:hover { 
  background: linear-gradient(135deg, #e5a842 0%, #a46d17 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(212, 154, 55, 0.4);
}
.btn-admin-danger { 
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); 
  color: #fff; 
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}
.btn-admin-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
  color: #fff;
}
.btn-admin-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); }

/* Forms in Admin - Premium Bootstrap-Aligned Styling */
.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-control, .form-select {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: #1e293b;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23334155' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 12px;
  padding-right: 36px;
}
.form-select option {
  padding: 8px 12px;
  font-size: 0.92rem;
  color: #1e293b;
  background: #ffffff;
}
.form-control:hover, .form-select:hover {
  border-color: #94a3b8;
  background-color: #ffffff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--admin-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(29, 77, 56, 0.15);
  outline: none;
}
.form-control::placeholder {
  color: #94a3b8;
  font-size: 0.88rem;
}
.input-group-text {
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  color: #64748b;
  font-weight: 500;
  padding: 10px 14px;
}
.input-group > .input-group-text:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
.input-group > .form-control:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.form-floating > .form-control,
.form-floating > .form-select {
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  height: calc(3.5rem + 2px);
  line-height: 1.25;
}
.form-floating > label {
  color: #64748b;
  font-weight: 500;
  font-size: 0.9rem;
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--admin-primary);
  font-weight: 600;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
}
.admin-form-full { grid-column: span 2; }

/* Admin Mobile Sidebar Backdrop */
.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1040;
}
.admin-sidebar-backdrop.active {
  display: block;
}

/* Responsive Media Queries for Admin */
@media (max-width: 992px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh;
    z-index: 1050;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.3);
  }
  .admin-sidebar.active {
    left: 0;
  }
  .admin-topbar {
    padding: 0 16px;
  }
  .admin-content {
    padding: 20px 16px;
  }
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-form-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .admin-form-full {
    grid-column: span 1;
  }
}

@media (max-width: 576px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
  .admin-card-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .admin-card-body {
    padding: 16px;
  }
}


