/* ============================================================
   GTM SHELL — shared layout (sidebar, header, mobile nav)
   Desktop/tablet (768px+) and mobile (<768px) layouts differ.
   All values reference tokens.css only.
   ============================================================ */

.gtm-page {
  min-height: 100vh;
  background-color: var(--color-canvas);
  color: var(--color-on-surface);
}

.gtm-page .material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: var(--font-size-headline-sm);
  line-height: 1;
  display: inline-block;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.gtm-page .material-symbols-outlined--filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Visibility helpers */
.dash-show-desktop { display: none; }
.dash-show-mobile { display: block; }

@media (min-width: 768px) {
  .dash-show-desktop { display: block; }
  .dash-show-mobile { display: none; }
  .dash-show-desktop-flex { display: flex; }
}

@media (max-width: 767px) {
  .dash-show-desktop-flex { display: none; }
}

/* ----------------------------------------------------------
   DESKTOP SIDEBAR
---------------------------------------------------------- */
.dash-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 16rem;
  height: 100vh;
  display: none;
  flex-direction: column;
  padding: var(--space-sm);
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-outline-variant);
}

@media (min-width: 768px) {
  .dash-sidebar { display: flex; }
}

.dash-sidebar__brand {
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-sm);
}

.dash-sidebar__logo {
  color: var(--color-primary);
  margin-bottom: var(--space-base);
}

.dash-sidebar__tagline {
  color: var(--color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-base);
}

.dash-sidebar__section-label {
  padding: var(--space-sm) var(--space-sm) var(--space-base);
  color: var(--color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-default);
  color: var(--color-on-surface-variant);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dash-nav-link:hover {
  background-color: var(--color-surface-container-high);
  color: var(--color-on-surface);
}

.dash-nav-link--active {
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
  font-weight: var(--font-weight-label-md);
}

.dash-sidebar__cta {
  width: 100%;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  justify-content: center;
}

.dash-sidebar__footer {
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-outline-variant);
  display: flex;
  flex-direction: column;
  gap: var(--space-base);
}

.dash-upgrade-card {
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background-color: color-mix(in srgb, var(--color-primary-container) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
  margin-bottom: var(--space-sm);
}

.dash-upgrade-card__title {
  color: var(--color-primary);
  margin-bottom: var(--space-base);
}

.dash-upgrade-card__text {
  color: var(--color-on-surface-variant);
  font-size: 10px;
  margin-bottom: var(--space-xs);
}

.dash-upgrade-card__btn {
  width: 100%;
  padding: var(--space-xs);
  border-radius: var(--radius-default);
  font-size: var(--font-size-label-sm);
}

/* ----------------------------------------------------------
   DESKTOP HEADER
---------------------------------------------------------- */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 4rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-outline-variant);
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .dash-header { display: flex; }
}

.dash-header__search {
  position: relative;
  flex: 1;
  max-width: 36rem;
}

.dash-header__search-icon {
  position: absolute;
  left: var(--space-xs);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-on-surface-variant);
}

.dash-header__search-input {
  width: 100%;
  padding: var(--space-xs) var(--space-sm) var(--space-xs) calc(var(--space-md) + var(--space-xs));
  border: none;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-container-low);
  font-family: var(--font-family-base);
  font-size: var(--font-size-body-md);
  color: var(--color-on-surface);
  outline: none;
}

.dash-header__search-input:focus {
  box-shadow: 0 0 0 2px var(--color-primary-container);
}

.dash-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.dash-header__icon-btn {
  padding: var(--space-xs);
  border: none;
  background: transparent;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  border-radius: var(--radius-default);
  transition: color 0.15s ease;
}

.dash-header__icon-btn:hover {
  color: var(--color-primary);
}

.dash-header__divider {
  width: 1px;
  height: 2rem;
  background-color: var(--color-outline-variant);
  margin: 0 var(--space-xs);
}

.dash-header__profile {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.dash-header__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-primary-container);
}

.dash-header__profile-name {
  color: var(--color-on-surface);
  line-height: 1;
}

.dash-header__profile-role {
  color: var(--color-on-surface-variant);
  line-height: 1;
  margin-top: var(--space-base);
}

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

/* ----------------------------------------------------------
   DESKTOP MAIN
---------------------------------------------------------- */
.dash-main--desktop {
  display: none;
  margin-left: 16rem;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .dash-main--desktop { display: block; }
}

.dash-content {
  /* max-width: 87.5rem; */
  margin: 0 auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}


.dash-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-weight-label-md);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.dash-link:hover { text-decoration: underline; }

/* ----------------------------------------------------------
   MOBILE SHELL
---------------------------------------------------------- */
.dash-mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-margin-mobile);
  background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-outline-variant);
}

@media (min-width: 768px) {
  .dash-mobile-header { display: none; }
}

.dash-mobile-header__menu {
  padding: var(--space-xs);
  border: none;
  background: transparent;
  color: var(--color-on-surface-variant);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.dash-mobile-header__logo {
  height: 2rem;
  width: auto;
}

.dash-mobile-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-base);
}

.dash-mobile-header__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--color-outline-variant);
}

.dash-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: color-mix(in srgb, var(--color-on-background) 20%, transparent);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.dash-mobile-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

.dash-mobile-drawer {
  width: 16rem;
  height: 100%;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-overlay);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: var(--space-sm);
}

.dash-mobile-overlay--open .dash-mobile-drawer {
  transform: translateX(0);
}

.dash-mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-xs);
}

.dash-mobile-drawer__close {
  padding: var(--space-xs);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-on-surface-variant);
}

.dash-main--mobile {
  padding: 5rem var(--space-margin-mobile) 5.5rem;
  max-width: var(--layout-container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .dash-main--mobile { display: none; }
}

.dash-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 4.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-md);
  background-color: color-mix(in srgb, var(--color-surface) 90%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid color-mix(in srgb, var(--color-outline-variant) 30%, transparent);
}

@media (min-width: 768px) {
  .dash-bottom-nav { display: none; }
}

.dash-bottom-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-base);
  color: var(--color-on-surface-variant);
  text-decoration: none;
  font-size: var(--font-size-label-sm);
  transition: color 0.15s ease;
}

.dash-bottom-nav__link--active {
  color: var(--color-primary);
}

.dash-text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.dash-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

.dash-nav-link--button {
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
