/* ============================================
   ALO.BG - Dashboard Skeleton
   Shell/layout styles shared by all dashboard
   pages (sidebar, grid, content wrapper).
   Page-specific styles remain in account.css.
   ============================================ */

.dash {
  padding: var(--space-6) 0;
}

/* Mobile — drop dashboard chrome, нека всяка страница си контролира своето
   вертикално разстояние. На малък екран 24px+24px wrapper padding изяжда
   важно screen real estate (chat thread sticky header би оставал прекъснат
   от viewport top-а с 24px gap, например). */
@media (max-width: 767px) {
  .dash {
    padding: 0;
  }
}

.dash__grid {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 1024px) {
  .dash__grid {
    grid-template-columns: 270px 1fr;
  }
}

/* --- Sidebar --- */
.dash__sidebar {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  height: fit-content;
  align-self: start;
}

@media (max-width: 1023px) {
  .dash__sidebar { display: none; }
}

.dash__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-3);
  border-bottom: 1.5px solid var(--color-border);
}

.dash__user-avatar {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}

.dash__user-avatar-image{
object-fit: cover;
  border-radius: 50%;
  width: 100%;
  height: 100%;
}

.dash__user-info {
  min-width: 0;
}

.dash__user-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  color: var(--color-text);
}

.dash__user-since {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Sidebar nav groups */
.dash__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash__nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  color: var(--color-text);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  position: relative;
  border-bottom: 1px solid var(--color-border-light);
}

.dash__nav-link:last-child {
  border-bottom: none;
}

.dash__nav-link:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.dash__nav-link.is-active {
  background-color: rgba(25, 118, 210, 0.08);
  color: var(--color-secondary);
  font-weight: var(--font-weight-semibold);
}

.dash__nav-link.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--color-secondary);
  border-radius: 0 3px 3px 0;
}

.dash__nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-text);
}

.dash__nav-link.is-active svg {
  color: var(--color-secondary);
}

.dash__nav-link:hover svg {
  color: var(--color-text);
}

.dash__nav-link--accent {
  color: var(--color-primary);
}

.dash__nav-link--accent svg {
  color: var(--color-primary);
}

.dash__nav-link--accent:hover {
  background-color: rgba(229, 57, 53, 0.08);
  color: var(--color-primary-dark);
}

/* Sidebar badges */
.dash__badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.6875rem;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: #fff;
  margin-left: auto;
  line-height: 1;
}

.dash__nav-link.badge .dash__badge{
  display:inline-flex;
}

.dash__badge:empty {
  display: none;
}

.dash__wallet-balance {
  margin-left: auto;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  background: rgba(25, 118, 210, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* --- Sidebar groups --- */
.dash__group {
  display: grid;
  grid-template-rows: auto 0fr;
  align-content: start;
  align-items: start;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border-light);
  transition: grid-template-rows .22s ease;
}

.dash__group--open {
  grid-template-rows: auto 1fr;
}

.dash__group--active {
  margin: 4px 0;
  border-bottom: none;
  border-radius: var(--radius-lg);
  background: rgba(25, 118, 210, 0.08);
}

.dash__group .dash__group-head {
  border-bottom: none;
  cursor: pointer;
  user-select: none;
}

.dash__group--active .dash__group-head,
.dash__group--active .dash__group-head:hover {
  background: transparent;
}

.dash__group .dash__group-head::before {
  display: none;
}

.dash__group-chevron {
  order: 1;
  display: inline-flex;
  margin-left: auto;
  color: var(--color-text-muted);
  transition: transform .22s ease;
}

.dash__group--open .dash__group-chevron {
  transform: rotate(180deg);
}

.dash__group--active .dash__group-chevron {
  color: var(--color-secondary);
}

.dash__nav-link .dash__group-chevron svg {
  width: 16px;
  height: 16px;
  color: inherit;
}

.dash__group-head .dash__badge {
  order: 2;
  margin-left: 8px;
}

.dash__group--open .dash__group-head.badge .dash__badge {
  display: none;
}

.dash__subnav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 0 8px 0 0;
  visibility: hidden;
  transition: padding .22s ease, visibility 0s linear .22s;
}

.dash__group--open .dash__subnav {
  padding-bottom: 10px;
  visibility: visible;
  transition: padding .22s ease, visibility 0s;
}

.dash__subnav::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 2px;
  bottom: 14px;
  width: 2px;
  border-radius: 2px;
  background: var(--color-border);
}

.dash__group--active .dash__subnav::before {
  background: rgba(25, 118, 210, 0.18);
}

.dash__subnav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dash__subnav-link:hover {
  background: var(--color-bg);
  color: var(--color-secondary);
  text-decoration: none;
}

.dash__group--active .dash__subnav-link:hover {
  background: rgba(255, 255, 255, 0.7);
}

.dash__subnav-link--active,
.dash__group--active .dash__subnav-link--active:hover {
  background: var(--color-surface);
  color: var(--color-secondary);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 1px 2px rgba(25, 118, 210, 0.12);
}

.dash__subnav-link--active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--color-secondary);
}

.dash__subnav-link--danger {
  margin-top: 6px;
  color: var(--color-danger);
}

.dash__subnav-link--danger:hover,
.dash__group--active .dash__subnav-link--danger:hover {
  background: rgba(211, 47, 47, 0.08);
  color: var(--color-danger);
}

.dash__subnav-label {
  min-width: 0;
}

.dash__subnav-count {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.dash__subnav-count--alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

/* --- Main Content wrapper --- */
.dash__content {
  min-width: 0;
}

.dash__header {
  margin-bottom: var(--space-5);
}

.dash__header--flex {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
