/* ==========================================================
   DoMyDesk Core - Header / barre Dashboard
   Layout commun uniquement. Les couleurs restent fournies par
   le thème actif via les variables CSS --*.
   ========================================================== */

html.dmd-dashboard-page {
  --topbar-height: 26px;
}

html.dmd-dashboard-page body {
  padding-top: var(--topbar-height);
}

html.dmd-dashboard-page #top-bar {
  height: var(--topbar-height);
}

.dmd-dashboard-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  height: 100%;
  white-space: nowrap;
}

.dmd-dashboard-controls .dmd-header-select {
  width: auto;
  min-width: 90px;
  max-width: 130px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0 5px;
  border: 1px solid var(--border-color);
  border-radius: 1px;
  background: var(--input-bg);
  color: var(--text-color);
  box-shadow: none;
  font-size: 9px;
  line-height: 1;
}

.dmd-dashboard-controls .dmd-header-module-select {
  min-width: 82px;
  max-width: 155px;
}

.dmd-dashboard-controls .dmd-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 1px;
  background: var(--panel-bg);
  color: var(--text-color);
  box-shadow: none;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.dmd-dashboard-controls .dmd-header-action:hover {
  background: var(--primary-soft);
  border-color: var(--primary-color);
  color: var(--text-color);
  transform: none;
}

.dmd-dashboard-controls .dmd-header-action.delete {
  color: var(--danger-color);
}

html.dmd-dashboard-page #top-bar .center {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 48vw;
}

@media (max-width: 980px) {
  html.dmd-dashboard-page #top-bar .center {
    position: static;
    transform: none;
    margin-left: auto;
    margin-right: auto;
    max-width: 46vw;
    overflow-x: auto;
    scrollbar-width: none;
  }

  html.dmd-dashboard-page #top-bar .center::-webkit-scrollbar {
    display: none;
  }

  .dmd-dashboard-controls .dmd-header-select {
    min-width: 84px;
    max-width: 110px;
  }
}

@media (max-width: 700px) {
  html.dmd-dashboard-page {
    --topbar-height: 38px;
  }

  html.dmd-dashboard-page #top-bar {
    gap: 6px;
    padding-left: 7px;
    padding-right: 7px;
  }

  html.dmd-dashboard-page #top-bar .left #date,
  html.dmd-dashboard-page #top-bar .left #time,
  html.dmd-dashboard-page #top-bar .left #role {
    display: none;
  }

  html.dmd-dashboard-page #top-bar .right {
    gap: 3px;
  }

  html.dmd-dashboard-page #top-bar .center {
    max-width: 58vw;
  }
}

/* ==========================================================
   Quick-Session
   - couleurs fournies exclusivement par les variables du thème
   - le chrono est calculé côté navigateur, aucun polling serveur
   ========================================================== */
.dmd-dashboard-controls .dmd-header-separator {
  flex: 0 0 1px;
  width: 1px;
  height: 14px;
  margin: 0 4px;
  background: var(--border-color);
  opacity: .8;
}

.dmd-dashboard-controls .dmd-header-quick-session {
  flex: 0 0 auto;
  width: auto;
  min-width: 20px;
  max-width: none;
  gap: 4px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

.dmd-dashboard-controls .dmd-header-quick-session.is-active {
  border-color: var(--primary-color);
  background: var(--primary-soft);
}

.dmd-quick-session-timer {
  display: inline-block;
  min-width: 48px;
  color: var(--text-color);
  font-size: 9px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.dmd-quick-session-timer.is-hidden {
  display: none;
}

.dmd-quick-session-tools {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 12px;
  z-index: 1090;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.dmd-quick-session-resolve {
  display: flex;
  align-items: center;
}

.dmd-quick-session-resolve button {
  width: auto;
  min-width: 0;
  min-height: 24px;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid var(--success-color);
  border-radius: 4px;
  background: var(--panel-bg);
  color: var(--text-color);
  box-shadow: 0 6px 18px var(--shadow-color);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.dmd-quick-session-resolve button:hover {
  background: var(--primary-soft);
  transform: none;
}

.dmd-quick-session-memory {
  position: relative;
}

.dmd-quick-session-memory summary {
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--panel-bg);
  color: var(--text-color);
  box-shadow: 0 6px 18px var(--shadow-color);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.dmd-quick-session-memory summary::-webkit-details-marker {
  display: none;
}

.dmd-quick-session-memory[open] summary,
.dmd-quick-session-memory summary:hover {
  border-color: var(--primary-color);
  background: var(--primary-soft);
}

.dmd-quick-session-memory-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 290px;
  max-width: calc(100vw - 24px);
  padding: 9px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--panel-bg);
  color: var(--text-color);
  box-shadow: 0 10px 24px var(--shadow-color);
}

.dmd-quick-session-memory-panel strong {
  display: block;
  margin-bottom: 7px;
  color: var(--title-color);
  font-size: 11px;
}

.dmd-quick-session-memory-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px;
  border-top: 1px solid var(--border-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 10px;
}

.dmd-quick-session-memory-panel a:hover {
  background: var(--primary-soft);
}

.dmd-quick-session-memory-panel small {
  flex: 0 0 auto;
  color: var(--muted-color);
  font-size: 9px;
}

.dmd-quick-session-resolve button:disabled,
.dmd-dashboard-controls .dmd-header-quick-session:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 700px) {
  .dmd-dashboard-controls .dmd-header-separator {
    margin: 0 2px;
  }

  .dmd-quick-session-tools {
    top: calc(var(--topbar-height) + 6px);
    right: 8px;
  }

  .dmd-quick-session-memory-panel {
    right: auto;
    left: 0;
  }
}


/* ==========================================================
   Identité visuelle en haut du menu vertical
   ========================================================== */
.dmd-right-menu-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 8px 8px;
  overflow: hidden;
}
.dmd-right-menu-brand-avatar img {
  width: 72px;
  height: 72px;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--panel-bg);
}
.dmd-right-menu-brand-banner {
  border: 1px solid var(--border-color);
  border-radius: var(--radius, 14px);
  background: var(--panel-bg);
}
.dmd-right-menu-brand-banner img {
  width: 100%;
  max-height: 110px;
  display: block;
  object-fit: cover;
}
