/* ============================================================
   Techso Sign — App Styles
   ============================================================ */

/* Layout */
#app-wrapper { min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: #0d1b2a;
  min-height: 100vh;
  transition: transform .25s ease;
  z-index: 200;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: #0d6efd;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar .nav-link {
  color: rgba(255,255,255,.65);
  border-radius: 8px;
  padding: .55rem .85rem;
  font-size: .9rem;
  transition: background .15s, color .15s;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.sidebar .nav-link.active {
  background: #0d6efd;
  color: #fff;
}

.sidebar-footer { background: rgba(0,0,0,.2); }

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Main content */
.main-content {
  background: #f4f6f9;
  min-height: 100vh;
  overflow-x: clip; /* clip ≠ hidden : ne crée pas de contexte de défilement, laisse position:sticky fonctionner */
}

/* Top bar (mobile) */
.topbar {
  background: #0d1b2a;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Mobile sidebar toggle */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .main-content { min-height: 100vh; }
}

/* Utility */
.x-small { font-size: .72rem; }

.signatory-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Cards */
.card { border-radius: .75rem; }
.card-header { border-radius: .75rem .75rem 0 0 !important; }

/* Status badges (Bootstrap 5.3 subtle) */
.bg-secondary-subtle { background-color: #e9ecef !important; }
.bg-primary-subtle   { background-color: #cfe2ff !important; }
.bg-success-subtle   { background-color: #d1e7dd !important; }
.bg-danger-subtle    { background-color: #f8d7da !important; }
.bg-warning-subtle   { background-color: #fff3cd !important; }

/* Table */
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; }
.table td { font-size: .9rem; }

/* Stat icon */
.stat-icon { font-size: 1.3rem; }

/* ── Sidebar tree ─────────────────────────────────────────────────────────── */
.sidebar-tree {
  padding: 0 .5rem .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 4px;
}

.sidebar-tree-node {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  background: none;
  color: rgba(255,255,255,.55);
  border-radius: 6px;
  padding: .32rem .7rem;
  font-size: .83rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .13s, color .13s;
  line-height: 1.4;
}

.sidebar-tree-node:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.sidebar-tree-active {
  background: rgba(13,110,253,.35) !important;
  color: #fff !important;
}

.sidebar-tree-all { margin-bottom: 2px; }

.sidebar-tree-group { margin-bottom: 1px; }

/* Chevron rotatif */
.sidebar-tree-chevron {
  font-size: .65rem;
  flex-shrink: 0;
  transition: transform .18s ease;
}
.sidebar-tree-year.open .sidebar-tree-chevron {
  transform: rotate(90deg);
}

/* Sous-nœuds */
.sidebar-tree-children {
  display: none;
  padding-left: 1.1rem;
  margin-top: 1px;
}
.sidebar-tree-children.show { display: block; }

.sidebar-tree-leaf {
  font-size: .8rem;
  padding: .25rem .6rem;
  color: rgba(255,255,255,.45);
}

/* Badge compteur */
.sidebar-tree-badge {
  font-size: .68rem;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.5);
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c9d2; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8898aa; }
