/* ============================================================
   Team Helper Tools - Sidebar Agentic OS (reproduit le design
   Agentic OS : sidebar fixe 248px à gauche + drawer burger mobile).
   Charte Team Helper : 0 émoji, 0 long tiret, icônes SVG inline.
   ============================================================ */

/* Layout : la sidebar est fixe à gauche, le contenu est décalé.
   On enveloppe header+main+footer dans .th-layout (margin-left). */
.th-layout {
  margin-left: 248px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Sidebar (desktop) ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 248px;
  z-index: 1000;
  background: #ffffff;
  border-right: 1px solid #d8dee8;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 14px 20px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 8px 16px;
  border-bottom: 1px solid #d8dee8;
  margin-bottom: 14px;
}
.sidebar-brand .logo {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  text-decoration: none;
}
.sidebar-brand .logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.sidebar-brand .brand-text .name {
  font-weight: 800;
  font-size: 14px;
  color: #232d3a;
}
.sidebar-brand .brand-text .sub {
  font-size: 11.5px;
  color: #5a6474;
}

.sidebar-section {
  margin-top: 18px;
}
.sidebar-section .section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a6474;
  padding: 0 10px;
  margin-bottom: 8px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #232d3a;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover {
  background: #eef1f5;
}
.sidebar-nav a.is-active {
  background: #fff2dc;
  color: #d97e00;
  font-weight: 600;
}
.sidebar-nav .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
  color: #ef9400;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #d8dee8;
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding-bottom: 8px;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #5a6474;
  font-size: 13px;
  text-decoration: none;
  border-radius: 9px;
}
.sidebar-footer a:hover {
  background: #eef1f5;
  color: #d97e00;
}

/* ===== Burger / overlay / close (masqués sur desktop) ===== */
.sidebar-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #232d3a;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  margin-left: auto;
}
.sidebar-toggle:hover { background: #eef1f5; }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 999;
}
.sidebar-overlay[hidden] { display: none; }
.sidebar-close {
  display: none;
  border: none;
  background: transparent;
  color: #232d3a;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.mobile-header { display: none; }

/* ===== Mobile (<= 768px) : drawer burger ===== */
@media (max-width: 768px) {
  .th-layout { margin-left: 0; }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #ffffff;
    border-bottom: 1px solid #d8dee8;
    padding: 12px 16px;
  }
  .mobile-header .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mobile-header .mobile-brand .logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .mobile-header .mobile-brand .logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
  }
  .mobile-header .mobile-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }
  .mobile-header .mobile-brand .brand-text .name {
    font-weight: 800;
    font-size: 14px;
    color: #232d3a;
  }
  .mobile-header .mobile-brand .brand-text .sub {
    font-size: 11.5px;
    color: #5a6474;
  }
  .mobile-header .sidebar-toggle {
    display: inline-flex;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-right: 1px solid #d8dee8;
    overflow-y: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 0 14px 20px;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-brand {
    border-bottom: 1px solid #d8dee8;
    margin-bottom: 14px;
    padding: 18px 8px 16px;
  }
  .sidebar-close {
    display: inline-flex;
    margin-left: auto;
    border: none;
    background: transparent;
    color: #232d3a;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
  }
  .sidebar-close:hover { background: #eef1f5; }
  .sidebar-section { margin-top: 18px; }
  .sidebar-section .section-label { display: block; }
  .sidebar-nav { flex-direction: column; }
  .sidebar-nav a { width: 100%; }
  .sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid #d8dee8; position: sticky; bottom: 0; background: #ffffff; padding-bottom: 8px; }
}
