/* c:/xampp/htdocs/ng/ngone/assets/css/dashboard.css */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-dark);
}

/* ==========================================================================
   Modern Dashboard Sidebar
   ========================================================================== */

:root {
  --sidebar-w: 205px;
}

.dashboard-sidebar {
  width: var(--sidebar-w, 205px);
  background: #ffffff;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  box-shadow: 1px 0 3px rgba(15, 23, 42, 0.03);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Custom Scrollbar */
.dashboard-sidebar ::-webkit-scrollbar,
.dashboard-sidebar::-webkit-scrollbar {
  width: 4px;
}
.dashboard-sidebar ::-webkit-scrollbar-thumb,
.dashboard-sidebar::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 4px;
}
.dashboard-sidebar ::-webkit-scrollbar-thumb:hover,
.dashboard-sidebar::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

/* Sidebar Header */
.sidebar-header {
  height: 60px;
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-shrink: 0;
  background: #ffffff;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.sidebar-brand-link .brand-img {
  height: 30px;
  width: auto;
  max-width: 65px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.store-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.store-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 82, 204, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.05em;
  width: fit-content;
  text-transform: uppercase;
  margin-top: 2px;
}

.admin-badge {
  color: #7c3aed;
  background: #f5f3ff;
}

.sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  background: #fee2e2;
  color: var(--danger);
  border-color: #fca5a5;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 0.65rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-section-title {
  padding: 0.6rem 0.5rem 0.2rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 700;
  user-select: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.46rem 0.55rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-link-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.sidebar-link:hover .sidebar-link-icon {
  color: var(--primary);
  transform: scale(1.05);
}

.sidebar-link.active {
  color: var(--primary);
  background: rgba(0, 82, 204, 0.07);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-link.active .sidebar-link-icon {
  color: var(--primary);
}

.sidebar-pill {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 4.5px;
  border-radius: 9999px;
  background: rgba(0, 82, 204, 0.12);
  color: var(--primary);
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.sidebar-external-icon {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-left: auto;
  transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover .sidebar-external-icon {
  transform: translate(2px, -2px);
  color: var(--primary);
}

/* Sidebar Footer & User Card */
.sidebar-footer {
  padding: 0.5rem 0.45rem;
  border-top: 1px solid var(--border-subtle);
  background: #ffffff;
  flex-shrink: 0;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s;
}

.sidebar-user-card:hover {
  border-color: #cbd5e1;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0052cc 0%, #2684ff 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 82, 204, 0.2);
}

.sidebar-user-info {
  min-width: 0;
  flex: 1;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.sidebar-user-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 1px;
}

.verified-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  flex-shrink: 0;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-subtle);
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Dashboard Main Content & Topbar
   ========================================================================== */

.dashboard-main {
  flex: 1;
  margin-left: var(--sidebar-w, 205px);
  width: calc(100% - var(--sidebar-w, 205px));
  min-width: 0;
  max-width: calc(100% - var(--sidebar-w, 205px));
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg-dark);
}

.dashboard-topbar {
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
}

.dashboard-body {
  padding: 1.75rem 2rem;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

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

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-cyan::before { background: var(--secondary); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-main);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.mobile-sidebar-toggle:hover {
  background: var(--bg-surface-elevated);
  border-color: #cbd5e1;
}

.mobile-sidebar-toggle:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 900px) {
  .dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    width: 260px;
    max-width: 85vw;
    transform: translateX(-100%);
    z-index: 999;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }

  .dashboard-sidebar.active {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .mobile-sidebar-toggle {
    display: inline-flex;
  }

  .dashboard-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .dashboard-topbar {
    padding: 0 1.25rem;
  }

  .dashboard-body {
    padding: 1.25rem;
  }
}

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

  .dashboard-topbar {
    padding: 0 1rem;
  }

  .dashboard-body {
    padding: 1rem;
  }
}
