/* ================================================================
 * ProVsup Design System — pv-aside.css
 * Sidebar : horloge, navigation, widgets.
 * Toutes les règles ciblent des classes pv-* — zéro conflit Bootstrap.
 * Nécessite : pv-variables.css + pv-layout.css
 * ================================================================ */


/* ── Conteneur ──────────────────────────────────────────────────── */

.pv-theme .pv-aside {
  height: 100%;
  overflow: hidden;
  background: var(--rail-bg);
  display: flex;
  flex-direction: column;
}

.pv-theme .pv-aside-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 0 0;
}


/* ── Header aside ───────────────────────────────────────────────── */

.pv-theme .pv-aside-header {
  flex: none;
  height: var(--cmdbar-h);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  border-bottom: 1px solid oklch(1 0 0 / 0.08);
}

.pv-theme .pv-aside-brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 4px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  min-width: 0;
  transition: opacity 0.14s;
}

.pv-theme .pv-aside-brand:hover {
  text-decoration: none;
  color: #fff;
  opacity: 0.8;
}

.pv-theme .pv-aside-brand > i {
  font-size: 18px;
  flex: none;
  color: var(--accent);
}

.pv-theme .pv-aside-brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-theme .pv-aside-toggle {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  color: var(--rail-fg);
  font-size: 15px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  transition: background 0.14s, color 0.14s;
}

.pv-theme .pv-aside-toggle:hover {
  background: oklch(1 0 0 / 0.08);
  color: #fff;
  text-decoration: none;
}

.pv-theme .app-aside-folded .pv-aside-header {
  justify-content: center;
  padding: 0;
}



/* ── Navigation ─────────────────────────────────────────────────── */

.pv-theme .pv-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: oklch(1 0 0 / 0.10) transparent;
}

.pv-theme .pv-nav::-webkit-scrollbar {
  width: 4px;
}

.pv-theme .pv-nav::-webkit-scrollbar-thumb {
  background: oklch(1 0 0 / 0.15);
  border-radius: var(--r-pill);
}

.pv-theme .pv-nav-list {
  list-style: none;
  padding: 4px 0;
  margin: 0;
}

/* ── Item ───────────────────────────────────────────────────────── */

.pv-theme .pv-nav-item {
  padding: 1px 8px;
  list-style: none;
}

.pv-theme .pv-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--r-md);
  color: var(--rail-fg);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.14s, color 0.14s;
}

.pv-theme .pv-nav-link:hover {
  background: oklch(1 0 0 / 0.08);
  color: #fff;
  text-decoration: none;
}

.pv-theme .pv-nav-item.active .pv-nav-link,
.pv-theme .pv-nav-item.active .pv-nav-link:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-ring);
}

/* ── Icône ──────────────────────────────────────────────────────── */

.pv-theme .pv-nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex: none;
  color: inherit;
}

/* ── Label ──────────────────────────────────────────────────────── */

.pv-theme .pv-nav-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  opacity: 1;
  transition: opacity 0.15s ease;
}

/* ── Badges ─────────────────────────────────────────────────────── */

.pv-theme .pv-nav-badge {
  font-size: 10px;
  font-weight: 700;
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
  line-height: 18px;
  border-radius: var(--r-pill);
  text-align: center;
  flex: none;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.12s ease;
}

.pv-theme .pv-nav-badge-warn {
  background: var(--warn);
  color: #1a1d23;
}

.pv-theme .pv-nav-badge-muted {
  background: oklch(1 0 0 / 0.12);
  color: var(--rail-fg);
}

/* ── Séparateur ─────────────────────────────────────────────────── */

.pv-theme .pv-nav-separator {
  display: flex;
  align-items: center;
  height: 16px;
  padding: 0 8px;
  overflow: hidden;
}

.pv-theme .pv-nav-separator::before,
.pv-theme .pv-nav-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: oklch(1 0 0 / 0.10);
  transition: opacity 0.12s ease;
}

.pv-theme .pv-nav-sep-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(1 0 0 / 0.28);
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  margin: 0 8px;
  transition: opacity 0.12s ease;
}


/* ── État FOLDED ────────────────────────────────────────────────── */

/* Replié : pas de changement de layout sur nav-link — l'icône se centre
   naturellement grâce au padding: 0 10px dans un aside de 56px */
.pv-theme .app-aside-folded .pv-nav-label {
  flex: 0 0 0px;
  opacity: 0;
}

.pv-theme .app-aside-folded .pv-nav-badge {
  flex: 0 0 0px;
  min-width: 0;
  padding: 0;
  opacity: 0;
}

.pv-theme .app-aside-folded .pv-nav-separator {
  height: 16px;
  padding: 0 12px;
  gap: 0;
}

.pv-theme .app-aside-folded .pv-nav-separator::after {
  flex: 0 0 0px;
  opacity: 0;
}

.pv-theme .app-aside-folded .pv-nav-sep-label {
  flex: 0 0 0px;
  opacity: 0;
}


/* ── Utilitaires pv-hide-folded / pv-show-folded ────────────────── */

.pv-theme .app-aside-folded .pv-hide-folded {
  display: none;
}

.pv-theme .pv-show-folded {
  display: none;
}

.pv-theme .app-aside-folded .pv-show-folded {
  display: flex;
}


/* ── Widgets (items customisés en bas de l'aside) ───────────────── */

.pv-theme .pv-widgets {
  padding: 8px;
  font-family: var(--font-ui);
  color: var(--rail-fg);
  max-height: 400px;
  opacity: 1;
  overflow: hidden;
  transition: opacity 0.15s ease, max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1), padding 0.2s ease;
}

.pv-theme .app-aside-folded .pv-widgets {
  opacity: 0;
  max-height: 0;
  padding: 0;
}

.pv-theme .pv-widget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  min-height: 16px;
  overflow: hidden;
}

.pv-theme .pv-widget-name {
  font-size: 11px;
  font-weight: 500;
  color: oklch(1 0 0 / 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pv-theme .pv-widget-value,
.pv-theme .pv-widget-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: oklch(1 0 0 / 0.50);
  white-space: nowrap;
  flex: none;
  margin-left: 6px;
}

.pv-theme .pv-widget-prog {
  flex: 1;
  min-width: 0;
}

/* Barres de progression dans les widgets */
.pv-theme .pv-widgets .progress {
  background: oklch(1 0 0 / 0.10);
  border-radius: var(--r-pill);
  box-shadow: none;
  overflow: hidden;
  height: 6px;
  margin: 3px 0;
}

.pv-theme .pv-widgets .progress .progress-bar {
  border-radius: var(--r-pill);
  box-shadow: none;
  min-width: 0;
  overflow: hidden;
}

/* Couleurs des barres selon le type Bootstrap (conservé car progressbar directive) */
.pv-theme .pv-widgets .progress-bar.progress-bar-success,
.pv-theme .pv-widgets .progress-bar.bg-success  { background-color: var(--ok)     !important; }
.pv-theme .pv-widgets .progress-bar.progress-bar-warning,
.pv-theme .pv-widgets .progress-bar.bg-warning  { background-color: var(--warn)   !important; }
.pv-theme .pv-widgets .progress-bar.progress-bar-danger,
.pv-theme .pv-widgets .progress-bar.bg-danger   { background-color: var(--stop)   !important; }
.pv-theme .pv-widgets .progress-bar.progress-bar-info,
.pv-theme .pv-widgets .progress-bar.bg-info     { background-color: var(--info)   !important; }
.pv-theme .pv-widgets .progress-bar.bg-primary  { background-color: var(--accent) !important; }

/* Texte dans les barres (type 4) */
.pv-theme .pv-widgets .pv-progress-label {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
  color: #fff;
}


/* ── Footer aside ───────────────────────────────────────────────── */

.pv-theme .pv-aside-footer {
  flex: none;
  padding: 10px 14px 12px;
  border-top: 1px solid oklch(1 0 0 / 0.08);
  overflow: hidden;
  transition: padding-left 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              padding-right 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.pv-theme .app-aside-folded .pv-aside-footer {
  padding-left: 0;
  padding-right: 0;
}

.pv-theme .pv-aside-logo-link {
  display: flex;
  text-decoration: none;
}

.pv-theme .pv-aside-logo-link:hover { opacity: 0.8; text-decoration: none; }

.pv-theme .pv-aside-logo-svg {
  display: block;
  width: 120px;
  min-width: 120px;
  height: auto;
  flex-shrink: 0;
  /* centre le SVG dans le contenu déplié (220 - 28px padding - 120px SVG) / 2 */
  margin-left: calc((var(--rail-expanded-w) - 28px - 120px) / 2);
  transition: margin-left 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.pv-theme .app-aside-folded .pv-aside-logo-svg {
  /* centre le A (à x≈23.4px dans 120px) dans les 56px de l'aside replié */
  margin-left: 5px;
}

.pv-theme .pv-logo-letters {
  fill: var(--rail-fg);
  transition: opacity 0.15s ease;
}

.pv-theme .app-aside-folded .pv-logo-letters {
  opacity: 0;
}

.pv-theme .pv-logo-a {
  fill: var(--accent);
  transition: fill 0.3s ease;
}
