/* ==========================================================================
   NAYAA WONDERS - SECURE ADMIN PANEL STYLESHEET
   Clean, modern, highly responsive dashboard design
   ========================================================================== */

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

:root {
  --admin-primary: #FF3366;
  --admin-primary-dark: #D91B4C;
  --admin-sidebar-bg: #1E293B;
  --admin-sidebar-text: #94A3B8;
  --admin-sidebar-active: #FFFFFF;
  --admin-bg: #F8FAFC;
  --admin-card-bg: #FFFFFF;
  --admin-border: #E2E8F0;
  
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #0284C7;
  
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.03);
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--admin-bg);
  color: #334155;
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  height: 36px;
  width: auto;
}

.sidebar-title {
  color: #FFF;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-title span {
  color: var(--admin-primary);
}

.sidebar-nav {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  padding: 12px 14px 6px;
  letter-spacing: 0.8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--admin-sidebar-text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFF;
}

.sidebar-link.active {
  background: var(--admin-primary);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.35);
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--admin-primary);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-user-details {
  display: flex;
  flex-direction: column;
}

.admin-user-name {
  color: #FFF;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-user-role {
  color: #64748B;
  font-size: 0.72rem;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.admin-main {
  margin-left: 260px;
  width: calc(100% - 260px);
  max-width: calc(100% - 260px);
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
}

.admin-topbar {
  background: #FFF;
  height: 64px;
  border-bottom: 1px solid var(--admin-border);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-view-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F1F5F9;
  color: #334155;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-view-store:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.admin-content {
  padding: 24px 30px 40px 30px;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   ALERTS / FLASH MESSAGES
   ========================================================================== */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.alert-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert-warning {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

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

.stat-card {
  background: #FFF;
  border-radius: 14px;
  padding: 22px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 18px;
}

.stat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0F172A;
  margin-top: 2px;
}

/* ==========================================================================
   ADMIN CARDS & TABLES
   ========================================================================== */
.card {
  background: #FFF;
  border-radius: 14px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0F172A;
}

.card-body {
  padding: 20px 24px;
  width: 100%;
  box-sizing: border-box;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  box-sizing: border-box;
}

.admin-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 13px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

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

.table-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #F1F5F9;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: #ECFDF5; color: #065F46; }
.badge-warning { background: #FFFBEB; color: #92400E; }
.badge-danger { background: #FEF2F2; color: #991B1B; }
.badge-info { background: #EFF6FF; color: #1E40AF; }

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--admin-primary);
  color: #FFF;
}

.btn-primary:hover {
  background: var(--admin-primary-dark);
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.76rem;
}

.btn-outline {
  border-color: var(--admin-border);
  background: #FFF;
  color: #334155;
}

.btn-outline:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-danger {
  background: #FEE2E2;
  color: #DC2626;
}

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

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #1E293B;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--admin-primary);
  cursor: pointer;
}

/* Also support .table alias for .admin-table */
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  background: #F8FAFC;
  padding: 12px 18px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
}

.table td {
  padding: 14px 18px;
  font-size: 0.88rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.table tr:hover td {
  background-color: #F8FAFC;
}

/* Sidebar Backdrop for Mobile */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 95;
}

.admin-sidebar-overlay.active {
  display: block;
}

.mobile-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--admin-border);
  color: #334155;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.25rem;
  cursor: pointer;
  margin-left: auto;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1200px) {
  .admin-content {
    padding: 20px 24px 36px 24px;
  }
}

@media (max-width: 992px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .mobile-sidebar-toggle {
    display: inline-flex !important;
  }
  .sidebar-close-btn {
    display: inline-block !important;
  }
  .admin-content {
    padding: 18px 20px 30px 20px;
  }
}

@media (max-width: 768px) {
  .admin-topbar {
    padding: 0 16px;
    height: 56px;
  }
  .page-header-title {
    font-size: 1.05rem;
  }
  .topbar-actions .btn-view-store span {
    display: none;
  }
  .admin-content {
    padding: 14px 14px 24px 14px;
  }
  .card-header {
    padding: 14px 16px;
  }
  .card-body {
    padding: 16px 14px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .stat-card {
    padding: 14px;
    gap: 12px;
  }
  .stat-icon-wrap {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .stat-value {
    font-size: 1.25rem;
  }
  .form-row, .form-row-3, .form-row-2-1 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .admin-content {
    padding: 12px 10px 20px 10px;
  }
}

/* Sticky Bulk Action Toolbar for Orders */
#bulk-toolbar {
  position: sticky;
  top: 64px;
  z-index: 100;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

@media (max-width: 900px) {
  #bulk-toolbar {
    flex-direction: column;
    align-items: stretch !important;
    padding: 12px 16px;
    gap: 10px;
  }
  #bulk-action-form {
    flex-direction: column;
    align-items: stretch !important;
    width: 100%;
    gap: 8px;
  }
  #bulk-action-form select,
  #bulk-action-form button {
    width: 100% !important;
  }
}

/* ==========================================================================
   ADMIN SHIMMER & SKELETON TABLE SYSTEM
   ========================================================================== */
@keyframes shimmerPulseAdmin {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.admin-shimmer-cell {
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 30%, #CBD5E1 50%, #E2E8F0 70%, #F1F5F9 100%);
  background-size: 200% 100%;
  animation: shimmerPulseAdmin 1.5s infinite linear;
}

.admin-shimmer-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 30%, #CBD5E1 50%, #E2E8F0 70%, #F1F5F9 100%);
  background-size: 200% 100%;
  animation: shimmerPulseAdmin 1.5s infinite linear;
}

#admin-global-shimmer {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #4F46E5, #06B6D4, #10B981);
  background-size: 200% 100%;
  animation: shimmerPulseAdmin 1.2s infinite linear;
  z-index: 999999;
  transition: width 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  opacity: 0;
}
#admin-global-shimmer.active {
  opacity: 1;
}

