/* =========================================================================
   PHANTOMBOT - SHADCN DARK THEME
   Simple, sobre, fonctionnel et soigné.
   ========================================================================= */

:root {
  --background: #09090b;
  --foreground: #fafafa;

  --card: #09090b;
  --card-foreground: #fafafa;

  --popover: #09090b;
  --popover-foreground: #fafafa;

  --primary: #fafafa;
  --primary-foreground: #18181b;

  --secondary: #27272a;
  --secondary-foreground: #fafafa;

  --muted: #18181b;
  --muted-foreground: #a1a1aa;

  --accent: #27272a;
  --accent-foreground: #fafafa;

  --destructive: #ef4444;
  --destructive-foreground: #fafafa;

  --border: #27272a;
  --border-subtle: #1f1f23;
  --border-strong: #3f3f46;
  --input: #27272a;
  --ring: #71717a;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar discrète */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* =========================================================================
   LAYOUT ARCHITECTURE
   ========================================================================= */

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar Shadcn (h-14, border-b, backdrop-blur) */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-brand-title .tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  border: 1px solid var(--border);
}

.live-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.live-ping-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
}

/* Shadcn Tabs List (segmented pill) */
.nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--muted);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--foreground);
}

.tab-btn.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.badge-count {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: var(--border);
  color: var(--muted-foreground);
}

.tab-btn.active .badge-count {
  background: #27272a;
  color: var(--foreground);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-wrapped-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(236, 72, 153, 0.16));
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #f3e8ff;
  padding: 5px 11px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-wrapped-nav:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(236, 72, 153, 0.28));
  border-color: rgba(216, 180, 254, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

/* Boutons Shadcn */
.btn-icon-subtle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-icon-subtle:hover {
  background: var(--secondary);
  color: var(--foreground);
  border-color: var(--border-strong);
}

.btn-logout:hover {
  color: var(--destructive);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

/* Contenu Principal */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 60px 24px;
}

.section-pane {
  display: none;
}

.section-pane.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-heading-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--foreground);
}

.section-lead {
  color: var(--muted-foreground);
  font-size: 13px;
}

/* =========================================================================
   COMPOSANT : CARTES KPI (SHADCN CARD)
   ========================================================================= */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.kpi-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition);
}

.kpi-block:hover {
  border-color: var(--border-strong);
}

.kpi-heading {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: -0.01em;
}

.kpi-figure {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi-footnote {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* =========================================================================
   VUE 1 : SALONS EN DIRECT
   ========================================================================= */

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.channel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: border-color var(--transition);
}

.channel-card:hover {
  border-color: var(--border-strong);
}

.channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.channel-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.channel-tag::before {
  content: "#";
  color: var(--muted-foreground);
  font-weight: 400;
}

.channel-occupancy {
  font-size: 11px;
  font-weight: 500;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background-color var(--transition);
}

.live-member-item:hover {
  background: var(--muted);
}

.member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.avatar-live-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  border: 1.5px solid var(--background);
}

.member-names {
  display: flex;
  flex-direction: column;
}

.member-display-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.2;
}

.member-username {
  font-size: 11px;
  color: var(--muted-foreground);
}

.member-duration-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   VUE 2 : PROFILS MEMBRES
   ========================================================================= */

.search-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 260px;
}

.search-icon-symbol {
  position: absolute;
  left: 10px;
  color: var(--muted-foreground);
  font-size: 12px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px 0 28px;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.user-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition);
}

.user-card:hover {
  border-color: var(--border-strong);
  background: rgba(24, 24, 27, 0.4);
}

.user-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.user-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.2;
}

.user-card-handle {
  font-size: 11px;
  color: var(--muted-foreground);
}

.user-metrics-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--muted);
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}

.metric-datum {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 11px;
  color: var(--muted-foreground);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.metric-highlight {
  color: var(--foreground);
}

/* =========================================================================
   VUE 3 : TIMELINE & LOGS
   ========================================================================= */

/* =========================================================================
   VUE 3 : TIMELINE & LOGS — RUBAN TOOLBAR HAUT DE GAMME
   ========================================================================= */

.timeline-toolbar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.toolbar-left-group,
.toolbar-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Contrôle segmenté (Segmented Control Shadcn) */
.segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}

.segmented-item {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.segmented-item:hover {
  color: var(--foreground);
}

.segmented-item.active {
  background: #27272a;
  color: #fafafa;
  border: 1px solid #3f3f46;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
}

/* Composant Sélecteur Calendrier Popover (Shadcn Date Range Picker) */
.calendar-picker-wrapper {
  position: relative;
  display: inline-flex;
}

.date-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0 10px;
  height: 32px;
  cursor: pointer;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
}

.date-picker-trigger:hover {
  background: var(--secondary);
  border-color: var(--border-strong);
}

.date-picker-trigger.open {
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.range-calendar-icon {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.range-picker-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--foreground);
  white-space: nowrap;
}

.range-chevron-icon {
  color: var(--muted-foreground);
  transition: transform var(--transition);
}

.date-picker-trigger.open .range-chevron-icon {
  transform: rotate(180deg);
}

/* Popover Calendrier */
.calendar-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: 290px;
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.7);
  animation: popoverFadeIn 0.15s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-month-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  text-transform: capitalize;
}

.cal-nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.cal-nav-btn:hover {
  color: var(--foreground);
  border-color: var(--border-strong);
  background: var(--secondary);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  row-gap: 2px;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--foreground);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background 0.1s ease;
  user-select: none;
}

.cal-day-cell.other-month {
  color: #3f3f46;
}

.cal-day-cell.today:not(.range-start):not(.range-end)::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fafafa;
}

.cal-day-cell:hover:not(.other-month):not(.range-start):not(.range-end) {
  background: var(--secondary);
}

.cal-day-cell.range-start,
.cal-day-cell.range-end,
.cal-day-cell.selected-single {
  background: #fafafa !important;
  color: #09090b !important;
  font-weight: 600;
}

.cal-day-cell.range-start:not(.range-end) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.cal-day-cell.range-end:not(.range-start) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.cal-day-cell.range-between {
  background: rgba(250, 250, 250, 0.12) !important;
  border-radius: 0;
  color: #fafafa;
}

.cal-day-cell.range-hover {
  background: rgba(250, 250, 250, 0.08);
}

.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.cal-selection-text {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cal-btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
}

.cal-btn-secondary:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.cal-btn-primary {
  background: #fafafa;
  border: 1px solid #fafafa;
  color: #09090b;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
}

.cal-btn-primary:hover {
  background: #e4e4e7;
}

/* Sélecteurs stylisés avec icône de préfixe */
.custom-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  height: 32px;
  transition: border-color var(--transition);
}

.custom-select-wrap:hover {
  border-color: var(--border-strong);
}

.custom-select-wrap:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.select-prefix-icon {
  position: absolute;
  left: 10px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.clean-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 0 28px 0 30px;
  height: 100%;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.clean-select option {
  background: var(--popover);
  color: var(--foreground);
}

/* Grilles KPIs dédiées */
.timeline-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 960px) {
  .timeline-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .timeline-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* Grille Profil 3 par 3 (2 lignes de 3 colonnes) */
.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 960px) {
  .profile-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .profile-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.chart-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.chart-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-canvas-box {
  height: 260px;
  position: relative;
  width: 100%;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color var(--transition);
}

.timeline-entry:hover {
  border-color: var(--border-strong);
}

.timeline-entry-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-node {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.node-join {
  background: #22c55e;
}

.node-leave {
  background: #ef4444;
}

.node-archive {
  background: #6366f1;
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  min-width: 55px;
}

.timeline-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.timeline-prose {
  font-size: 13px;
  color: var(--foreground);
}

.timeline-prose strong {
  font-weight: 500;
  color: var(--foreground);
}

.timeline-channel-tag {
  color: var(--muted-foreground);
  font-weight: 500;
}

.timeline-tag-duration {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

/* Empty State sobre */
.empty-presence-panel {
  padding: 40px 24px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.empty-presence-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.empty-presence-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* =========================================================================
   VUE 4 : PAGE PROFIL DÉDIÉE
   ========================================================================= */

.profile-back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.profile-back-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}

.profile-back-btn:hover {
  background: var(--secondary);
  color: var(--foreground);
  border-color: var(--border-strong);
}

.profile-back-btn svg {
  transition: transform var(--transition);
}

.profile-back-btn:hover svg {
  transform: translateX(-2px);
}

.profile-hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.profile-hero-identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar-xl {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.profile-hero-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.015em;
}

.profile-id-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.profile-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.profile-handle {
  color: var(--muted-foreground);
}

.profile-dot-separator {
  color: var(--border-strong);
}

.profile-status-text {
  color: var(--muted-foreground);
  font-size: 12px;
}

/* =========================================================================
   COMPOSANT : DIALOG / MODAL (SHADCN DIALOG)
   ========================================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--background);
  z-index: 10;
}

.modal-user-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.modal-title-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.modal-close-trigger {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}

.modal-close-trigger:hover {
  color: var(--foreground);
  border-color: var(--border-strong);
  background: var(--secondary);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Tableau Shadcn Table */
.sessions-table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.sessions-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.sessions-table th {
  background: var(--muted);
  padding: 10px 14px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.sessions-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--foreground);
}

.sessions-table tr:last-child td {
  border-bottom: none;
}

.sessions-table tr:hover td {
  background: rgba(39, 39, 42, 0.4);
}

.copresent-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.copresent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all var(--transition);
}

.copresent-chip:hover {
  background: var(--secondary);
  color: var(--foreground);
  border-color: var(--border-strong);
}

.copresent-chip-avatar {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
}

/* =========================================================================
   COMPOSANT : GANTT CHRONOLOGIE DE CO-PRÉSENCE PAR SESSION (STYLE SHADCN)
   ========================================================================= */

.btn-gantt-trigger {
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-gantt-trigger:hover {
  background: var(--secondary);
  border-color: var(--border-strong);
  color: #fafafa;
}

.session-modal-card {
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: modalScaleUp 0.15s ease-out;
  overflow: hidden;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.session-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.session-modal-icon-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-modal-icon-title svg {
  color: var(--muted-foreground);
}

.session-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
  font-family: var(--font-sans);
}

.session-modal-subtitle {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 3px;
}

/* Règle de temps / Ticks horizontaux */
.session-ruler-track {
  margin: 16px 24px 6px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.session-ruler-tick {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Liste Gantt */
.session-gantt-list {
  padding: 12px 24px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

.session-gantt-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}

.session-gantt-row:hover {
  background: rgba(39, 39, 42, 0.4);
}

.gantt-user-profile {
  width: 160px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}

.gantt-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.gantt-names-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gantt-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-user-handle {
  font-size: 10px;
  color: var(--muted-foreground);
}

/* Barres de Timeline */
.gantt-track-container {
  flex: 1;
  height: 10px;
  background: #18181b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  position: relative;
  display: flex;
  align-items: center;
}

.gantt-bar-presence {
  position: absolute;
  top: 0;
  height: 8px;
  background: #22c55e;
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gantt-bar-presence:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.6);
}

.gantt-duration-col {
  width: 65px;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.session-modal-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted-foreground);
  background: #09090b;
}

.session-footer-count {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* =========================================================================
   PAGE DE CONNEXION (SHADCN LOGIN)
   ========================================================================= */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--background);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-header {
  text-align: left;
}

.brand-glyph {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.02em;
}

.brand-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 4px;
  line-height: 1.4;
}

.alert-message {
  display: none;
  font-size: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field {
  width: 100%;
  height: 38px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 38px 0 12px;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
}

.input-field:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.input-field::placeholder {
  color: var(--muted-foreground);
}

.input-action-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.input-action-btn:hover {
  color: var(--foreground);
}

/* Bouton Shadcn Primary (White on Dark) */
.btn-primary {
  width: 100%;
  height: 38px;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-primary:hover {
  background: #e4e4e7;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted-foreground);
  padding-top: 4px;
}

.security-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #22c55e;
}

/* =========================================================================
   EXPLORATEUR DE TABLES SQL
   ========================================================================= */

.db-tables-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.db-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-mono);
}

.db-nav-pill:hover {
  background: var(--accent);
  color: var(--foreground);
  border-color: var(--border-strong);
}

.db-nav-pill.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.db-nav-pill .pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
}

.db-nav-pill.active .pill-count {
  background: rgba(0, 0, 0, 0.2);
}

.db-tables-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.db-table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: border-color var(--transition);
}

.db-table-card:hover {
  border-color: var(--border-strong);
}

.db-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(24, 24, 27, 0.6);
  border-bottom: 1px solid var(--border);
}

.db-table-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.db-table-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  border: 1px solid var(--border);
  color: #38bdf8;
}

.db-table-name {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--foreground);
}

.db-table-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-meta-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.db-meta-badge.highlight {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}

.db-schema-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(9, 9, 11, 0.4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
}

.db-col-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--background);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  color: var(--muted-foreground);
}

.db-col-tag .col-type {
  color: #71717a;
  font-size: 10px;
}

.db-col-tag.is-pk {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
}

.db-table-scroll {
  width: 100%;
  overflow-x: auto;
  max-height: 480px;
}

.db-raw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.db-raw-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #18181b;
  padding: 9px 14px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.db-raw-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--foreground);
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-raw-table tr:hover td {
  background: rgba(39, 39, 42, 0.4);
}

.db-raw-table tr:last-child td {
  border-bottom: none;
}

.db-cell-null {
  color: #71717a;
  font-style: italic;
  font-size: 11px;
}

.db-cell-json {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: #18181b;
  border: 1px solid var(--border);
  color: #a1a1aa;
  font-size: 11px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-cell-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.db-cell-avatar img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.db-empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 13px;
}

/* =========================================================================
   RESPONSIVE DESIGN
   ========================================================================= */

@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
  }
  .main-content {
    padding: 20px 16px 40px 16px;
  }
  .live-grid, .users-grid {
    grid-template-columns: 1fr;
  }
  .search-field-wrap {
    width: 100%;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .db-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

