/* shell.css — layout applicatif : sidebar, topbar, footer */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* --------------------------------------------------------------- Sidebar */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, rgba(15, 17, 28, 0.92), rgba(11, 13, 22, 0.92));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
}

.brand-mark--xs {
  width: 16px;
  height: 16px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-copy span {
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--muted);
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.nav-link .icon {
  width: 19px;
  height: 19px;
  color: var(--muted);
  transition: color 0.18s var(--ease);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.nav-link.is-active {
  background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.1));
  border-color: var(--accent-line);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-link.is-active .icon {
  color: var(--accent-2);
}

.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.28);
  border: 1px solid var(--accent-line);
  color: #dcd7ff;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
}

/* Promo (bas de sidebar) */

.promo {
  margin-top: auto;
  padding: 17px 15px 15px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(160px 90px at 90% 0%, rgba(245, 185, 66, 0.14), transparent 70%),
    linear-gradient(160deg, rgba(27, 24, 44, 0.95), rgba(19, 20, 33, 0.95));
  border: 1px solid rgba(245, 185, 66, 0.18);
}

.promo-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(245, 185, 66, 0.14);
  color: var(--warning);
  margin-bottom: 11px;
}

.promo h3 {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 7px;
}

.promo p {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.sidebar-backdrop {
  display: none;
}

/* --------------------------------------------------------------- Topbar */

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  background: rgba(10, 11, 18, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.burger {
  display: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
}

.burger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(620px, 100%);
  height: 42px;
  padding: 0 12px 0 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.searchbox:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
}

.searchbox-text {
  flex: 1;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

kbd {
  padding: 2.5px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 11.5px;
  font-family: var(--font-body);
  font-weight: 500;
}

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

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

/* Dropdowns */

.dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  min-width: 250px;
  padding: 10px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
  z-index: 60;
}

.dropdown.is-open .dropdown-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.dropdown-panel h4 {
  font-size: 13.5px;
  padding: 6px 8px 8px;
}

.dropdown-panel--narrow {
  min-width: 240px;
}

.dropdown-panel--narrow p {
  padding: 4px 8px 8px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 10px 0 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.user-chip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.user-chip-name {
  font-size: 14px;
  font-weight: 500;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.18s var(--ease);
}

.dropdown.is-open .icon-chevron {
  transform: rotate(180deg);
}

.avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: var(--grad-accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  flex: none;
}

.avatar--lg {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 17px;
}

.dropdown-panel--user {
  min-width: 270px;
  padding: 8px;
}

.user-panel-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 9px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 7px;
}

.user-panel-head div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-panel-head strong {
  font-family: var(--font-display);
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.menu-item .icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.menu-item--danger:hover {
  background: rgba(255, 107, 129, 0.12);
  color: var(--danger);
}

.menu-item--danger:hover .icon {
  color: var(--danger);
}

/* --------------------------------------------------------------- Vue */

.view {
  flex: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 26px 28px 54px;
}

.view:focus {
  outline: none;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 17px 20px 21px;
  color: var(--muted-2);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}

.dot-sep {
  opacity: 0.6;
}

/* Skeleton de chargement */

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.skeleton-block {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.045) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-hero {
  height: 260px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 18px;
}

.skeleton-panel {
  height: 330px;
}

.skeleton-side {
  height: 330px;
}

/* --------------------------------------------------------------- Responsive */

@media (max-width: 1080px) {
  .skeleton-row {
    grid-template-columns: 1fr;
  }
  .skeleton-side {
    display: none;
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-w: 78px;
  }

  .sidebar {
    padding: 20px 12px 16px;
    align-items: center;
  }

  .brand {
    padding: 4px 0;
  }

  .brand-copy,
  .nav-link span:not(.nav-count),
  .promo {
    display: none;
  }

  .nav {
    width: 100%;
  }

  .nav-link {
    justify-content: center;
    padding: 12px 0;
    position: relative;
  }

  .nav-count {
    position: absolute;
    top: 5px;
    right: 9px;
    margin: 0;
    min-width: 17px;
    padding: 0 4px;
    font-size: 10px;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 262px;
    align-items: stretch;
    transform: translateX(-102%);
    transition: transform 0.24s var(--ease);
    box-shadow: var(--shadow-2);
  }

  body.nav-open .sidebar {
    transform: none;
  }

  .brand-copy,
  .nav-link span:not(.nav-count),
  .promo {
    display: revert;
  }

  .promo {
    display: block;
  }

  .nav-link {
    justify-content: flex-start;
    padding: 11px 13px;
  }

  .nav-count {
    position: static;
    margin-left: auto;
    min-width: 22px;
    padding: 1px 7px;
    font-size: 11.5px;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 12, 0.6);
    backdrop-filter: blur(3px);
    z-index: 35;
  }

  .burger {
    display: grid;
    place-items: center;
  }

  .topbar {
    padding: 0 14px;
    gap: 10px;
  }

  .searchbox {
    flex: 1;
    width: auto;
  }

  .searchbox-text {
    display: none;
  }

  .user-chip-name {
    display: none;
  }

  .view {
    padding: 20px 16px 44px;
  }
}
