*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --nav-h: 58px;
  --sb-w: 255px;

  /* Palette NGPA Solutions — Rouge / Noir / Blanc */
  --dark:          #111111;
  --dark-hover:    #1C1C1C;
  --dark-active:   #242424;
  --accent:        #CC1017;
  --accent-light:  rgba(204, 16, 23, 0.12);
  --accent-border: rgba(204, 16, 23, 0.45);

  --on-dark:       #F0F0F0;
  --on-dark-muted: #888888;
  --separator:     rgba(255,255,255,0.08);

  --bg:            #F5F5F5;
  --surface:       #FFFFFF;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--dark);
}

/* ─────────────── NAVBAR ─────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #111111;
  border-bottom: 1px solid var(--separator);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  display: block;
  background: #FFFFFF;
  border-radius: 5px;
  padding: 4px 8px;
}

.nav-sep {
  width: 1px;
  height: 26px;
  background: #FFFFFF;
  margin: 0 18px;
}

.nav-hub-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #FFFFFF;
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-breadcrumb {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.nav-breadcrumb .active {
  color: #FFFFFF;
  font-weight: 500;
}

/* ─────────────── LAYOUT ─────────────── */
.layout {
  display: flex;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
}

/* ─────────────── SIDEBAR ─────────────── */
.sidebar {
  width: var(--sb-w);
  background: var(--dark);
  border-right: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

/* Scrollbar fine */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sb-section-label {
  padding: 20px 16px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #FFFFFF;
}

/* Category */
.category { margin-bottom: 2px; }

.cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.cat-header:hover { background: rgba(255,255,255,0.04); }

.cat-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.cat-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #FFFFFF;
  flex: 1;
}

.cat-arrow {
  font-size: 9px;
  color: #FFFFFF;
  transition: transform 0.2s ease;
}

.category.open .cat-arrow { transform: rotate(90deg); }

/* Items */
.cat-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.category.open .cat-items { max-height: 2000px; }

.widget-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 28px;
  font-size: 13px;
  color: #FFFFFF;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.widget-item:hover {
  background: rgba(255,255,255,0.04);
  color: #FFFFFF;
  border-left-color: rgba(204, 16, 23, 0.4);
}

.widget-item.active {
  background: var(--accent-light);
  color: #FFFFFF;
  border-left-color: var(--accent);
}

.wi-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.wi-label { flex: 1; }

/* ─────────────── MAIN ─────────────── */
.main {
  flex: 1;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

/* Loading bar */
.load-bar {
  position: sticky;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  transition: width 0.4s ease, opacity 0.3s;
  z-index: 10;
  border-radius: 0 2px 2px 0;
  opacity: 0;
  flex-shrink: 0;
}

.load-bar.loading {
  opacity: 1;
  width: 80%;
  transition: width 2s ease;
}

.load-bar.done {
  width: 100%;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.4s ease 0.2s;
}

/* Empty state */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.empty-state svg { opacity: 0.25; }

.empty-state p {
  font-size: 14px;
  font-weight: 500;
  color: #999;
}

.empty-state small {
  font-size: 12px;
  color: #BBBBBB;
}

/* Vue catégorie — tous les widgets empilés */
.category-view {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 45px 24px;
  flex: 1;
}

.category-view.visible { display: flex; }

.cat-widget-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 800px;
}

.cat-widget-block .widget-title {
  width: 100%;
}

.cat-widget-block iframe {
  border: none;
  display: block;
  max-width: 100%;
}

/* Conteneur centré du widget */
.widget-container {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 45px 24px;
  flex: 1;
}

.widget-container.visible {
  display: flex;
}

.widget-title {
  font-size: 16px;
  font-weight: 700;
  color: #111111;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: 100%;
  max-width: 800px;
  padding-bottom: 10px;
  border-bottom: 2px solid #CC1017;
}

/* iFrame — dimensions appliquées dynamiquement via JS selon le widget */
.widget-frame {
  max-width: 100%;
  border: none;
  display: block;
}
