/* Dashboard shell — drawer/sidebar + embedded panels */
body.dashboard-locked { overflow-x: hidden; }

/* Hamburger (mobile only) */
.dash-nav-trigger {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border: 1px solid rgba(148,163,184,0.22);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.dash-nav-trigger:hover { background: #f1f5f9; }
.dash-nav-trigger-lines { display: flex; flex-direction: column; gap: 4px; width: 16px; }
.dash-nav-trigger-lines span { display: block; height: 2px; border-radius: 2px; background: #0f172a; }

/* Drawer backdrop */
.dash-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.6);
  z-index: 9000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(4px);
}
body.dash-drawer-open .dash-drawer-backdrop { opacity: 1; pointer-events: auto; }

/* Drawer (mobile) */
.dash-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(300px, 88vw);
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  z-index: 9100;
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 12px 0 40px rgba(0,0,0,0.35);
  overflow: hidden;
}
body.dash-drawer-open .dash-drawer { transform: translateX(0); }

/* Account settings card */
.dash-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  margin: 16px 12px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
  width: calc(100% - 24px);
}
.dash-account-card:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(99,102,241,0.35);
}
.dash-drawer--merchant .dash-account-card:hover {
  border-color: rgba(13,148,136,0.35);
}

.dash-account-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  flex-shrink: 0;
}
.dash-drawer--merchant .dash-account-avatar {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.dash-account-meta { flex: 1; min-width: 0; }
.dash-account-meta strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dash-plan-pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.35;
  max-width: 100%;
  color: #a5b4fc;
  background: rgba(99,102,241,0.22);
  padding: 4px 8px;
  border-radius: 999px;
  margin-top: 2px;
}
.dash-drawer--merchant .dash-plan-pill {
  color: #5eead4;
  background: rgba(13,148,136,0.22);
}

.dash-drawer-close {
  position: absolute;
  top: 14px; right: 12px;
  width: 30px; height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* Nav — fixed height, no scroll */
.dash-drawer-nav {
  flex: 1;
  overflow: hidden;
  padding: 10px 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
}

.dash-drawer-group { display: flex; flex-direction: column; gap: 3px; }
.dash-drawer-divider {
  height: 1px;
  background: rgba(148,163,184,0.12);
  margin: 10px 12px;
}

.dash-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: 600 0.86rem/1.3 inherit;
  transition: background 0.14s, color 0.14s;
}
.dash-drawer-link:hover,
.dash-drawer-link:focus-visible {
  background: rgba(255,255,255,0.08);
  color: #fff;
  outline: none;
}

.dash-drawer-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
  color: #94a3b8;
}

/* Decision Studio card */
.dash-studio-card {
  margin: 8px 12px 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.22), rgba(139,92,246,0.16));
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-drawer--merchant .dash-studio-card {
  background: linear-gradient(135deg, rgba(13,148,136,0.22), rgba(20,184,166,0.16));
  border-color: rgba(13,148,136,0.35);
}
.dash-studio-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}
.dash-studio-body { flex: 1; min-width: 0; }
.dash-studio-body strong {
  display: block;
  color: #fff;
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1.15;
}
.dash-studio-body small {
  display: block;
  color: #94a3b8;
  font-size: 0.68rem;
  margin-top: 2px;
}
.dash-studio-btn {
  border: none;
  background: #fff;
  color: #0f172a;
  padding: 6px 12px;
  border-radius: 8px;
  font: 700 0.72rem inherit;
  cursor: pointer;
  flex-shrink: 0;
}

/* Sign out */
.dash-signout {
  margin: 8px 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 24px);
  border: 1px solid rgba(148,163,184,0.15);
  background: transparent;
  color: #f87171;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: 700 0.83rem inherit;
  text-align: left;
}
.dash-signout:hover { background: rgba(248,113,113,0.1); }
.dash-signout .dash-drawer-icon { background: rgba(248,113,113,0.15); color: #f87171; }

/* Embedded panel (iframe overlay) */
.dash-shell-panel {
  position: fixed; inset: 0;
  z-index: 9200;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}
.dash-shell-panel[hidden] { display: none !important; }

.dash-shell-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #0f172a;
  color: #fff;
  flex-shrink: 0;
}
.dash-shell-back {
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}
.dash-shell-back:hover { background: rgba(255,255,255,0.2); }
#dashShellTitle { font-weight: 600; font-size: 0.95rem; }

.dash-shell-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

body.dash-panel-open { overflow: hidden; }

/* ═══ DESKTOP: sidebar becomes permanent ═══ */
@media (min-width: 1024px) {
  .dash-nav-trigger,
  #dashMenuBtn { display: none !important; }
  .dash-drawer-backdrop { display: none !important; }
  .dash-drawer-close { display: none !important; }
  .dash-drawer {
    transform: translateX(0) !important;
    box-shadow: none;
    width: 272px;
  }
}
