import { jsxs as a, jsx as e } from "react/jsx-runtime";
import { useState as A } from "react";
import { Link as n } from "react-router-dom";
import { useTranslation as T } from "react-i18next";
import { ArrowLeft as b, Users as m, ChevronRight as o, RefreshCw as U, UserCheck as p, UserX as j, UserPlus as G, Activity as u, AlertTriangle as g, Key as z, Shield as $, Monitor as f, Globe as D, TrendingUp as E, Clock as I, Zap as L, HelpCircle as P, Code2 as B, ArrowRight as M, Info as q } from "lucide-react";
const c = {
  totalUsers: 248,
  activeUsers: 211,
  inactiveUsers: 37,
  newUsers: 18,
  totalSessions: 1342,
  failedLogins: 7,
  totalRoles: 6,
  totalPermissions: 42,
  usersLoggedInRecently: 94
}, N = [
  { status: "Active", count: 211 },
  { status: "Inactive", count: 37 }
], y = [
  { roleName: "Administrator", count: 12 },
  { roleName: "Support Agent", count: 78 },
  { roleName: "Manager", count: 31 },
  { roleName: "Viewer", count: 90 },
  { roleName: "Developer", count: 37 }
], w = [
  { userId: "1", fullName: "Thomas Müller", email: "thomas.muller@example.com", failedAttempts: 8, ipAddresses: ["192.168.1.1", "10.0.0.5", "172.16.0.2"] },
  { userId: "2", fullName: "Sarah Connor", email: "sarah.c@example.com", failedAttempts: 5, ipAddresses: ["203.0.113.42"] }
], F = [
  { userId: "3", fullName: "Alice Martin", duration: "2h 14m" },
  { userId: "4", fullName: "Jean Dupont", duration: "47m" },
  { userId: "5", fullName: "Maria Rossi", duration: "1h 32m" },
  { userId: "6", fullName: "Hans Scherer", duration: "23m" },
  { userId: "7", fullName: "Emma Wilson", duration: "3h 05m" }
], x = {
  totalActiveSessions: 23,
  byBrowser: [
    { browser: "Chrome", count: 14 },
    { browser: "Firefox", count: 5 },
    { browser: "Edge", count: 3 },
    { browser: "Safari", count: 1 }
  ],
  byCountry: [
    { country: "Switzerland", count: 11 },
    { country: "France", count: 7 },
    { country: "Germany", count: 4 },
    { country: "Italy", count: 1 }
  ]
}, i = Array.from({ length: 14 }, (r, l) => ({
  date: new Date(Date.now() - (13 - l) * 864e5).toISOString(),
  newUsers: Math.floor(Math.random() * 5),
  logins: Math.floor(Math.random() * 40 + 20)
})), H = [
  { label: "Desktop", value: 67, color: "var(--dataviz-cat-1)" },
  { label: "Mobile", value: 24, color: "var(--dataviz-cat-2)" },
  { label: "Tablet", value: 9, color: "var(--dataviz-cat-3)" }
], O = [
  { method: "GET", path: "/api/administration/users/dashboard/overview", handler: "GetOverview", permission: "administration.users.read", params: "?days=30" },
  { method: "GET", path: "/api/administration/users/dashboard/by-status", handler: "GetByStatus", permission: "administration.users.read", params: "" },
  { method: "GET", path: "/api/administration/users/dashboard/by-role", handler: "GetByRole", permission: "administration.users.read", params: "" },
  { method: "GET", path: "/api/administration/users/dashboard/by-type", handler: "GetByType", permission: "administration.users.read", params: "" },
  { method: "GET", path: "/api/administration/users/dashboard/login-activity", handler: "GetLoginActivity", permission: "administration.users.read", params: "?days=30" },
  { method: "GET", path: "/api/administration/users/dashboard/trends", handler: "GetTrends", permission: "administration.users.read", params: "?days=30" },
  { method: "GET", path: "/api/administration/users/dashboard/recent-users", handler: "GetRecentUsers", permission: "administration.users.read", params: "?limit=10" },
  { method: "GET", path: "/api/administration/users/dashboard/security-alerts", handler: "GetSecurityAlerts", permission: "administration.users.read", params: "?threshold=3&hours=24" },
  { method: "GET", path: "/api/administration/users/dashboard/active-sessions", handler: "GetActiveSessionsStats", permission: "administration.users.read", params: "" },
  { method: "GET", path: "/api/administration/users/dashboard/latest-active-sessions", handler: "GetLatestActiveSessions", permission: "administration.users.read", params: "?limit=5" }
], X = [
  { id: "BR-001", category: "Sécurité", key: "techRef.rules.br001" },
  { id: "BR-002", category: "UI / UX", key: "techRef.rules.br002" },
  { id: "BR-003", category: "Période", key: "techRef.rules.br003" },
  { id: "BR-004", category: "Navigation", key: "techRef.rules.br004" },
  { id: "BR-005", category: "Performance", key: "techRef.rules.br005" },
  { id: "BR-006", category: "Accès", key: "techRef.rules.br006" }
], J = {
  GET: "bg-[var(--info-bg)] text-[var(--info-text)] border-[var(--info-border)]",
  POST: "bg-[var(--success-bg)] text-[var(--success-text)] border-[var(--success-border)]",
  PUT: "bg-[var(--warning-bg)] text-[var(--warning-text)] border-[var(--warning-border)]",
  PATCH: "bg-[var(--warning-bg)] text-[var(--warning-text)] border-[var(--warning-border)]",
  DELETE: "bg-[var(--error-bg)] text-[var(--error-text)] border-[var(--error-border)]"
}, K = {
  Active: "var(--success-text)",
  Inactive: "var(--text-tertiary)"
}, k = [
  "var(--dataviz-cat-1)",
  "var(--dataviz-cat-2)",
  "var(--dataviz-cat-3)",
  "var(--dataviz-cat-4)",
  "var(--dataviz-cat-5)"
];
function s({ children: r }) {
  return /* @__PURE__ */ a("div", { className: "mt-3 flex items-start gap-2 px-3 py-2 rounded-md border-l-2 border-[var(--color-accent-500)] bg-[var(--bg-secondary)] text-xs text-[var(--text-secondary)]", children: [
    /* @__PURE__ */ e(q, { className: "h-3.5 w-3.5 flex-shrink-0 mt-0.5 text-[var(--color-accent-600)]" }),
    /* @__PURE__ */ e("span", { children: r })
  ] });
}
function Y() {
  const { t: r } = T("docsAdministrationUsersDashboard"), [l, C] = A(!1), h = N.reduce((t, d) => t + d.count, 0), S = Math.max(...y.map((t) => t.count), 1), v = Math.max(...i.flatMap((t) => [t.newUsers, t.logins]), 1);
  return /* @__PURE__ */ a("div", { className: "space-y-8 max-w-5xl mx-auto px-4 py-6", children: [
    /* @__PURE__ */ a(
      n,
      {
        to: "/docs/business/administration/users",
        className: "inline-flex items-center gap-1.5 text-sm text-[var(--color-accent-500)] hover:text-[var(--color-accent-600)] transition-colors",
        children: [
          /* @__PURE__ */ e(b, { className: "h-4 w-4" }),
          r("nav.backToAdmin")
        ]
      }
    ),
    /* @__PURE__ */ a("div", { children: [
      /* @__PURE__ */ a("div", { className: "flex items-center gap-3 mb-3", children: [
        /* @__PURE__ */ e("div", { className: "p-2 rounded-lg bg-[var(--color-accent-600)]/10", children: /* @__PURE__ */ e(m, { className: "h-6 w-6 text-[var(--color-accent-600)]" }) }),
        /* @__PURE__ */ a("div", { className: "min-w-0", children: [
          /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-[var(--text-primary)]", children: r("title") }),
          /* @__PURE__ */ e("p", { className: "text-xl text-[var(--color-accent-600)] font-medium mt-1", children: r("summary") }),
          /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)] mt-1", children: r("subtitle") })
        ] })
      ] }),
      /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-3 text-sm text-[var(--text-secondary)]", children: [
        /* @__PURE__ */ a("span", { children: [
          "6 ",
          r("header.businessRules")
        ] }),
        /* @__PURE__ */ e("span", { children: "·" }),
        /* @__PURE__ */ a("span", { children: [
          "10 ",
          r("header.apiEndpoints")
        ] }),
        /* @__PURE__ */ e("span", { children: "·" }),
        /* @__PURE__ */ a("span", { children: [
          "5 ",
          r("header.statuses")
        ] })
      ] })
    ] }),
    /* @__PURE__ */ a("section", { children: [
      /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)] mb-3 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-7 h-7 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-xs font-bold", children: "1" }),
        r("sections.objective")
      ] }),
      /* @__PURE__ */ e("div", { className: "p-4 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)] leading-relaxed", children: r("objective") }) })
    ] }),
    /* @__PURE__ */ a("section", { children: [
      /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)] mb-3 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-7 h-7 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-xs font-bold", children: "2" }),
        r("sections.access")
      ] }),
      /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-4 bg-[var(--bg-card)] space-y-3", children: [
        /* @__PURE__ */ a("div", { children: [
          /* @__PURE__ */ e("div", { className: "text-xs font-medium text-[var(--text-secondary)] mb-2", children: r("access.navigation") }),
          /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-sm", children: [
            /* @__PURE__ */ e("span", { className: "px-2 py-0.5 rounded bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border-color)] font-medium", children: "Platform" }),
            /* @__PURE__ */ e(o, { className: "h-3.5 w-3.5 text-[var(--text-muted)]" }),
            /* @__PURE__ */ e("span", { className: "px-2 py-0.5 rounded bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border-color)] font-medium", children: "Administration" }),
            /* @__PURE__ */ e(o, { className: "h-3.5 w-3.5 text-[var(--text-muted)]" }),
            /* @__PURE__ */ e("span", { className: "px-2 py-0.5 rounded bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border-color)] font-medium", children: "Users" }),
            /* @__PURE__ */ e(o, { className: "h-3.5 w-3.5 text-[var(--text-muted)]" }),
            /* @__PURE__ */ e("span", { className: "px-2 py-0.5 rounded bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)] border border-[var(--color-accent-500)]/20 font-medium", children: r("access.module") })
          ] })
        ] }),
        /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-3 text-xs min-w-0", children: [
          /* @__PURE__ */ e("div", { className: "min-w-0 px-3 py-1.5 rounded-full bg-[var(--bg-secondary)] border border-[var(--border-color)] font-mono text-[var(--text-secondary)] break-all", children: "/administration/users/dashboard" }),
          /* @__PURE__ */ e("div", { className: "min-w-0 px-3 py-1.5 rounded-full bg-[var(--color-accent-600)]/10 border border-[var(--color-accent-500)]/20 text-[var(--color-accent-700)] font-mono break-all", children: "administration.users.read" })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ a("section", { children: [
      /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)] mb-3 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-7 h-7 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-xs font-bold", children: "3" }),
        r("sections.dashboard")
      ] }),
      /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg overflow-hidden bg-[var(--bg-card)] shadow-sm", children: [
        /* @__PURE__ */ a("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--bg-secondary)] flex items-center justify-between", children: [
          /* @__PURE__ */ a("div", { children: [
            /* @__PURE__ */ a("h3", { className: "text-sm font-bold flex items-center gap-2 text-[var(--text-primary)]", children: [
              /* @__PURE__ */ e(m, { className: "h-4 w-4" }),
              r("dashboard.pageTitle")
            ] }),
            /* @__PURE__ */ e("p", { className: "text-xs text-[var(--text-secondary)] mt-0.5", children: r("dashboard.pageSubtitle") })
          ] }),
          /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ a("select", { className: "px-2 py-1 text-xs border border-[var(--border-color)] bg-[var(--bg-primary)] rounded-lg text-[var(--text-secondary)]", children: [
              /* @__PURE__ */ e("option", { children: r("dashboard.days7") }),
              /* @__PURE__ */ e("option", { selected: !0, children: r("dashboard.days30") }),
              /* @__PURE__ */ e("option", { children: r("dashboard.days90") })
            ] }),
            /* @__PURE__ */ a("button", { className: "flex items-center gap-1 px-2.5 py-1 text-xs border border-[var(--border-color)] bg-[var(--bg-primary)] rounded-lg text-[var(--text-secondary)]", children: [
              /* @__PURE__ */ e(U, { className: "w-3 h-3" }),
              r("dashboard.refresh")
            ] })
          ] })
        ] }),
        /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ a("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3", children: [
          /* @__PURE__ */ a("div", { className: "p-3 rounded-lg border bg-[var(--info-bg)] border-[var(--info-border)]", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center justify-between mb-1", children: [
              /* @__PURE__ */ e("span", { className: "text-xs text-[var(--info-text)] opacity-80", children: r("dashboard.kpi.totalUsers") }),
              /* @__PURE__ */ e(m, { className: "h-4 w-4 text-[var(--info-text)]" })
            ] }),
            /* @__PURE__ */ e("div", { className: "text-2xl font-bold text-[var(--info-text)]", children: c.totalUsers })
          ] }),
          /* @__PURE__ */ a("div", { className: "p-3 rounded-lg border bg-[var(--success-bg)] border-[var(--success-border)]", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center justify-between mb-1", children: [
              /* @__PURE__ */ e("span", { className: "text-xs text-[var(--success-text)] opacity-80", children: r("dashboard.kpi.active") }),
              /* @__PURE__ */ e(p, { className: "h-4 w-4 text-[var(--success-text)]" })
            ] }),
            /* @__PURE__ */ e("div", { className: "text-2xl font-bold text-[var(--success-text)]", children: c.activeUsers })
          ] }),
          /* @__PURE__ */ a("div", { className: "p-3 rounded-lg border bg-[var(--error-bg)] border-[var(--error-border)]", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center justify-between mb-1", children: [
              /* @__PURE__ */ e("span", { className: "text-xs text-[var(--error-text)] opacity-80", children: r("dashboard.kpi.inactive") }),
              /* @__PURE__ */ e(j, { className: "h-4 w-4 text-[var(--error-text)]" })
            ] }),
            /* @__PURE__ */ e("div", { className: "text-2xl font-bold text-[var(--error-text)]", children: c.inactiveUsers })
          ] }),
          /* @__PURE__ */ a("div", { className: "p-3 rounded-lg border bg-[var(--info-bg)] border-[var(--info-border)]", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center justify-between mb-1", children: [
              /* @__PURE__ */ e("span", { className: "text-xs text-[var(--info-text)] opacity-80", children: r("dashboard.kpi.newUsers") }),
              /* @__PURE__ */ e(G, { className: "h-4 w-4 text-[var(--info-text)]" })
            ] }),
            /* @__PURE__ */ e("div", { className: "text-2xl font-bold text-[var(--info-text)]", children: c.newUsers }),
            /* @__PURE__ */ e("div", { className: "text-xs text-[var(--info-text)] opacity-60 mt-0.5", children: r("dashboard.kpiPeriod") })
          ] }),
          /* @__PURE__ */ a("div", { className: "p-3 rounded-lg border bg-[var(--success-bg)] border-[var(--success-border)]", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center justify-between mb-1", children: [
              /* @__PURE__ */ e("span", { className: "text-xs text-[var(--success-text)] opacity-80", children: r("dashboard.kpi.sessions") }),
              /* @__PURE__ */ e(u, { className: "h-4 w-4 text-[var(--success-text)]" })
            ] }),
            /* @__PURE__ */ e("div", { className: "text-2xl font-bold text-[var(--success-text)]", children: c.totalSessions.toLocaleString() }),
            /* @__PURE__ */ e("div", { className: "text-xs text-[var(--success-text)] opacity-60 mt-0.5", children: r("dashboard.kpiPeriod") })
          ] }),
          /* @__PURE__ */ a("div", { className: "p-3 rounded-lg border bg-[var(--warning-bg)] border-[var(--warning-border)]", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center justify-between mb-1", children: [
              /* @__PURE__ */ e("span", { className: "text-xs text-[var(--warning-text)] opacity-80", children: r("dashboard.kpi.failedLogins") }),
              /* @__PURE__ */ e(g, { className: "h-4 w-4 text-[var(--warning-text)]" })
            ] }),
            /* @__PURE__ */ e("div", { className: "text-2xl font-bold text-[var(--warning-text)]", children: c.failedLogins }),
            /* @__PURE__ */ e("div", { className: "text-xs text-[var(--warning-text)] opacity-60 mt-0.5", children: r("dashboard.kpiPeriod") })
          ] })
        ] }) }),
        /* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ a("div", { className: "p-3 border-l-4 border-[var(--error-border)] bg-[var(--error-bg)] rounded-lg", children: [
          /* @__PURE__ */ a("h4", { className: "font-semibold text-[var(--error-text)] flex items-center gap-2 mb-2 text-sm", children: [
            /* @__PURE__ */ e(g, { className: "w-4 h-4" }),
            r("dashboard.securityAlerts.title"),
            " (",
            w.length,
            ")"
          ] }),
          /* @__PURE__ */ e("div", { className: "space-y-2", children: w.map((t) => /* @__PURE__ */ a("div", { className: "flex items-center justify-between p-2 bg-[var(--bg-card)] rounded border border-[var(--error-border)]/40 cursor-pointer", children: [
            /* @__PURE__ */ a("div", { children: [
              /* @__PURE__ */ e("span", { className: "text-xs font-medium text-[var(--text-primary)]", children: t.fullName }),
              /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-[var(--text-secondary)]", children: t.email })
            ] }),
            /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
              /* @__PURE__ */ a("span", { className: "text-xs text-[var(--error-text)] font-medium", children: [
                t.failedAttempts,
                " ",
                r("dashboard.securityAlerts.failedAttempts")
              ] }),
              /* @__PURE__ */ a("span", { className: "text-xs text-[var(--text-secondary)]", children: [
                t.ipAddresses.length,
                " ",
                r("dashboard.securityAlerts.ips")
              ] })
            ] })
          ] }, t.userId)) })
        ] }) }),
        /* @__PURE__ */ a("div", { className: "px-4 pb-4 grid grid-cols-1 lg:grid-cols-2 gap-4", children: [
          /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-3", children: [
            /* @__PURE__ */ a("h4", { className: "text-sm font-semibold mb-3 flex items-center gap-2 text-[var(--text-primary)]", children: [
              /* @__PURE__ */ e(p, { className: "h-4 w-4" }),
              r("dashboard.statusChart.title")
            ] }),
            /* @__PURE__ */ e("div", { className: "space-y-2", children: N.map((t) => {
              const d = h > 0 ? t.count / h * 100 : 0;
              return /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ e("div", { className: "w-20 text-xs text-[var(--text-secondary)]", children: t.status === "Active" ? r("dashboard.statusChart.active") : r("dashboard.statusChart.inactive") }),
                /* @__PURE__ */ e("div", { className: "flex-1 h-5 bg-[var(--bg-secondary)] rounded-full overflow-hidden", children: /* @__PURE__ */ e(
                  "div",
                  {
                    className: "h-full rounded-full",
                    style: { width: `${d}%`, backgroundColor: K[t.status] }
                  }
                ) }),
                /* @__PURE__ */ a("div", { className: "w-16 text-right text-xs", children: [
                  /* @__PURE__ */ e("span", { className: "font-medium text-[var(--text-primary)]", children: t.count }),
                  /* @__PURE__ */ a("span", { className: "text-[var(--text-muted)] ml-1", children: [
                    "(",
                    d.toFixed(0),
                    "%)"
                  ] })
                ] })
              ] }, t.status);
            }) })
          ] }),
          /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-3", children: [
            /* @__PURE__ */ a("h4", { className: "text-sm font-semibold mb-3 flex items-center gap-2 text-[var(--text-primary)]", children: [
              /* @__PURE__ */ e(z, { className: "h-4 w-4" }),
              r("dashboard.roleChart.title")
            ] }),
            /* @__PURE__ */ e("div", { className: "space-y-2", children: y.map((t, d) => {
              const R = t.count / S * 100;
              return /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ e("div", { className: "w-24 text-xs text-[var(--text-secondary)] truncate", children: t.roleName }),
                /* @__PURE__ */ e("div", { className: "flex-1 h-5 bg-[var(--bg-secondary)] rounded-full overflow-hidden", children: /* @__PURE__ */ e(
                  "div",
                  {
                    className: "h-full rounded-full",
                    style: { width: `${R}%`, backgroundColor: k[d % k.length] }
                  }
                ) }),
                /* @__PURE__ */ e("div", { className: "w-8 text-right text-xs font-medium text-[var(--text-primary)]", children: t.count })
              ] }, t.roleName);
            }) })
          ] })
        ] }),
        /* @__PURE__ */ a("div", { className: "px-4 pb-4 grid grid-cols-1 lg:grid-cols-2 gap-4", children: [
          /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-3", children: [
            /* @__PURE__ */ a("h4", { className: "text-sm font-semibold mb-3 flex items-center gap-2 text-[var(--text-primary)]", children: [
              /* @__PURE__ */ e($, { className: "h-4 w-4" }),
              r("dashboard.systemConfig.title")
            ] }),
            /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-3", children: [
              /* @__PURE__ */ a("div", { className: "text-center p-3 bg-[var(--bg-secondary)] rounded-lg", children: [
                /* @__PURE__ */ e("div", { className: "text-2xl font-bold", style: { color: "var(--dataviz-cat-1)" }, children: c.totalRoles }),
                /* @__PURE__ */ e("div", { className: "text-xs text-[var(--text-secondary)]", children: r("dashboard.systemConfig.roles") })
              ] }),
              /* @__PURE__ */ a("div", { className: "text-center p-3 bg-[var(--bg-secondary)] rounded-lg", children: [
                /* @__PURE__ */ e("div", { className: "text-2xl font-bold", style: { color: "var(--dataviz-cat-2)" }, children: c.totalPermissions }),
                /* @__PURE__ */ e("div", { className: "text-xs text-[var(--text-secondary)]", children: r("dashboard.systemConfig.permissions") })
              ] }),
              /* @__PURE__ */ a("div", { className: "text-center p-3 bg-[var(--bg-secondary)] rounded-lg", children: [
                /* @__PURE__ */ e("div", { className: "text-2xl font-bold", style: { color: "var(--dataviz-cat-3)" }, children: c.usersLoggedInRecently }),
                /* @__PURE__ */ e("div", { className: "text-xs text-[var(--text-secondary)]", children: r("dashboard.systemConfig.recentLogins") })
              ] }),
              /* @__PURE__ */ a("div", { className: "text-center p-3 bg-[var(--bg-secondary)] rounded-lg", children: [
                /* @__PURE__ */ e("div", { className: "text-2xl font-bold", style: { color: "var(--dataviz-cat-4)" }, children: x.totalActiveSessions }),
                /* @__PURE__ */ e("div", { className: "text-xs text-[var(--text-secondary)]", children: r("dashboard.systemConfig.activeSessions") })
              ] })
            ] })
          ] }),
          /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-3", children: [
            /* @__PURE__ */ a("h4", { className: "text-sm font-semibold mb-3 flex items-center gap-2 text-[var(--text-primary)]", children: [
              /* @__PURE__ */ e(f, { className: "h-4 w-4" }),
              r("dashboard.activeSessions.title")
            ] }),
            /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-4", children: [
              /* @__PURE__ */ a("div", { children: [
                /* @__PURE__ */ e("h5", { className: "text-xs font-medium text-[var(--text-secondary)] mb-2", children: r("dashboard.activeSessions.byBrowser") }),
                /* @__PURE__ */ e("div", { className: "space-y-1.5", children: x.byBrowser.map((t) => /* @__PURE__ */ a("div", { className: "flex items-center justify-between text-xs", children: [
                  /* @__PURE__ */ e("span", { className: "text-[var(--text-primary)]", children: t.browser }),
                  /* @__PURE__ */ e("span", { className: "font-medium text-[var(--text-primary)]", children: t.count })
                ] }, t.browser)) })
              ] }),
              /* @__PURE__ */ a("div", { children: [
                /* @__PURE__ */ a("h5", { className: "text-xs font-medium text-[var(--text-secondary)] mb-2 flex items-center gap-1", children: [
                  /* @__PURE__ */ e(D, { className: "w-3 h-3" }),
                  r("dashboard.activeSessions.byCountry")
                ] }),
                /* @__PURE__ */ e("div", { className: "space-y-1.5", children: x.byCountry.map((t) => /* @__PURE__ */ a("div", { className: "flex items-center justify-between text-xs", children: [
                  /* @__PURE__ */ e("span", { className: "text-[var(--text-primary)]", children: t.country }),
                  /* @__PURE__ */ e("span", { className: "font-medium text-[var(--text-primary)]", children: t.count })
                ] }, t.country)) })
              ] })
            ] })
          ] })
        ] }),
        /* @__PURE__ */ a("div", { className: "px-4 pb-4 grid grid-cols-1 lg:grid-cols-2 gap-4", children: [
          /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-3", children: [
            /* @__PURE__ */ a("h4", { className: "text-sm font-semibold mb-3 flex items-center gap-2 text-[var(--text-primary)]", children: [
              /* @__PURE__ */ e(f, { className: "h-4 w-4" }),
              r("dashboard.device.title")
            ] }),
            /* @__PURE__ */ e("div", { className: "space-y-2", children: H.map((t) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
              /* @__PURE__ */ e("div", { className: "w-14 text-xs text-[var(--text-secondary)]", children: t.label }),
              /* @__PURE__ */ e("div", { className: "flex-1 h-5 bg-[var(--bg-secondary)] rounded-full overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full rounded-full", style: { width: `${t.value}%`, backgroundColor: t.color } }) }),
              /* @__PURE__ */ a("div", { className: "w-8 text-right text-xs font-medium text-[var(--text-primary)]", children: [
                t.value,
                "%"
              ] })
            ] }, t.label)) })
          ] }),
          /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-3", children: [
            /* @__PURE__ */ a("h4", { className: "text-sm font-semibold mb-3 flex items-center gap-2 text-[var(--text-primary)]", children: [
              /* @__PURE__ */ e(u, { className: "h-4 w-4" }),
              r("dashboard.engagement.title")
            ] }),
            /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: [
              { label: "Durée moy.", value: "18m 32s", color: "var(--dataviz-cat-1)" },
              { label: "Rétention", value: "73%", color: "var(--dataviz-cat-2)" },
              { label: "Fréquence", value: "4.2×/sem", color: "var(--dataviz-cat-3)" },
              { label: "Rebond", value: "12%", color: "var(--dataviz-cat-4)" }
            ].map((t) => /* @__PURE__ */ a("div", { className: "text-center p-2 bg-[var(--bg-secondary)] rounded-lg", children: [
              /* @__PURE__ */ e("div", { className: "text-lg font-bold", style: { color: t.color }, children: t.value }),
              /* @__PURE__ */ e("div", { className: "text-xs text-[var(--text-secondary)]", children: t.label })
            ] }, t.label)) })
          ] })
        ] }),
        /* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-3", children: [
          /* @__PURE__ */ a("h4", { className: "text-sm font-semibold mb-3 flex items-center gap-2 text-[var(--text-primary)]", children: [
            /* @__PURE__ */ e(E, { className: "h-4 w-4" }),
            r("dashboard.trends.title"),
            " (",
            r("dashboard.trends.period"),
            ")"
          ] }),
          /* @__PURE__ */ a("div", { className: "flex items-center gap-4 mb-3", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 text-xs", children: [
              /* @__PURE__ */ e("div", { className: "w-3 h-3 rounded", style: { backgroundColor: "var(--dataviz-cat-1)" } }),
              /* @__PURE__ */ e("span", { className: "text-[var(--text-secondary)]", children: r("dashboard.trends.newUsers") })
            ] }),
            /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 text-xs", children: [
              /* @__PURE__ */ e("div", { className: "w-3 h-3 rounded", style: { backgroundColor: "var(--dataviz-cat-2)" } }),
              /* @__PURE__ */ e("span", { className: "text-[var(--text-secondary)]", children: r("dashboard.trends.logins") })
            ] })
          ] }),
          /* @__PURE__ */ e("div", { className: "h-24 flex items-end gap-0.5", children: i.map((t, d) => /* @__PURE__ */ a("div", { className: "flex-1 min-w-[8px] flex gap-px", children: [
            /* @__PURE__ */ e(
              "div",
              {
                className: "flex-1 rounded-t opacity-80",
                style: { height: `${t.newUsers / v * 100}%`, minHeight: t.newUsers > 0 ? "3px" : "0", backgroundColor: "var(--dataviz-cat-1)" }
              }
            ),
            /* @__PURE__ */ e(
              "div",
              {
                className: "flex-1 rounded-t opacity-80",
                style: { height: `${t.logins / v * 100}%`, minHeight: "3px", backgroundColor: "var(--dataviz-cat-2)" }
              }
            )
          ] }, `trend-${d}`)) }),
          /* @__PURE__ */ a("div", { className: "flex justify-between text-xs text-[var(--text-muted)] mt-1", children: [
            /* @__PURE__ */ e("span", { children: new Date(i[0].date).toLocaleDateString("fr-FR") }),
            /* @__PURE__ */ e("span", { children: new Date(i.at(-1).date).toLocaleDateString("fr-FR") })
          ] })
        ] }) }),
        /* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg overflow-hidden", children: [
          /* @__PURE__ */ a("div", { className: "px-3 py-2.5 border-b border-[var(--border-color)] bg-[var(--bg-secondary)] flex items-center gap-2", children: [
            /* @__PURE__ */ e(I, { className: "h-4 w-4 text-[var(--text-secondary)]" }),
            /* @__PURE__ */ e("h4", { className: "text-sm font-semibold text-[var(--text-primary)]", children: r("dashboard.latestSessions.title") })
          ] }),
          /* @__PURE__ */ a("table", { className: "w-full text-xs", children: [
            /* @__PURE__ */ e("thead", { className: "bg-[var(--bg-secondary)]", children: /* @__PURE__ */ a("tr", { children: [
              /* @__PURE__ */ e("th", { className: "text-left px-3 py-2 font-medium text-[var(--text-muted)]", children: r("dashboard.latestSessions.user") }),
              /* @__PURE__ */ e("th", { className: "text-right px-3 py-2 font-medium text-[var(--text-muted)]", children: r("dashboard.latestSessions.duration") })
            ] }) }),
            /* @__PURE__ */ e("tbody", { className: "divide-y divide-[var(--border-color)]", children: F.map((t) => /* @__PURE__ */ a("tr", { className: "hover:bg-[var(--bg-secondary)] cursor-pointer transition-colors", children: [
              /* @__PURE__ */ e("td", { className: "px-3 py-2 font-medium text-[var(--text-primary)]", children: t.fullName }),
              /* @__PURE__ */ e("td", { className: "px-3 py-2 text-right", children: /* @__PURE__ */ e("span", { className: "px-2 py-0.5 rounded text-xs font-medium bg-[var(--success-bg)] text-[var(--success-text)]", children: t.duration }) })
            ] }, t.userId)) })
          ] })
        ] }) })
      ] }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.header") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.kpis") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.securityAlerts") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.statusChart") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.roleChart") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.systemConfig") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.activeSessions") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.device") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.engagement") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.trends") }),
      /* @__PURE__ */ e(s, { children: r("dashboard.annotations.latestSessions") })
    ] }),
    /* @__PURE__ */ a("section", { children: [
      /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)] mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-7 h-7 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-xs font-bold", children: "4" }),
        r("sections.useCases")
      ] }),
      /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [1, 2, 3].map((t) => /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-4 bg-[var(--bg-card)]", children: [
        /* @__PURE__ */ e("div", { className: "text-xs font-semibold text-[var(--color-accent-600)] uppercase tracking-wide mb-1", children: r(`useCases.${t}.persona`) }),
        /* @__PURE__ */ e("p", { className: "text-sm font-medium mb-2", children: r(`useCases.${t}.situation`) }),
        /* @__PURE__ */ e("div", { className: "pt-2 border-t border-[var(--border-color)]", children: /* @__PURE__ */ a("p", { className: "text-xs text-[var(--text-muted)]", children: [
          /* @__PURE__ */ a("span", { className: "font-medium text-[var(--color-accent-600)]", children: [
            r("useCases.withLabel"),
            " "
          ] }),
          r(`useCases.${t}.outcome`)
        ] }) })
      ] }, `usecase-${t}`)) })
    ] }),
    /* @__PURE__ */ a("section", { children: [
      /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)] mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-7 h-7 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-xs font-bold", children: "5" }),
        r("sections.features")
      ] }),
      /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3, 4, 5].map((t) => /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-4 bg-[var(--bg-card)] flex gap-4", children: [
        /* @__PURE__ */ e("div", { className: "p-2 rounded-lg bg-[var(--color-accent-600)]/10 flex-shrink-0 h-fit", children: /* @__PURE__ */ e(L, { className: "h-4 w-4 text-[var(--color-accent-600)]" }) }),
        /* @__PURE__ */ a("div", { children: [
          /* @__PURE__ */ e("h3", { className: "text-sm font-semibold mb-1", children: r(`features.${t}.title`) }),
          /* @__PURE__ */ e("p", { className: "text-xs text-[var(--text-muted)] mb-2", children: r(`features.${t}.desc`) }),
          /* @__PURE__ */ a("div", { className: "px-3 py-1.5 rounded-md bg-[var(--bg-secondary)] text-xs", children: [
            /* @__PURE__ */ e("span", { className: "font-medium text-[var(--color-accent-600)]", children: "Ex. " }),
            r(`features.${t}.example`)
          ] })
        ] })
      ] }, `feature-${t}`)) })
    ] }),
    /* @__PURE__ */ a("section", { children: [
      /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)] mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-7 h-7 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-xs font-bold", children: "6" }),
        r("sections.faq")
      ] }),
      /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3, 4, 5].map((t) => /* @__PURE__ */ a("div", { className: "border border-[var(--border-color)] rounded-lg p-4 bg-[var(--bg-card)]", children: [
        /* @__PURE__ */ a("div", { className: "flex items-start gap-2 mb-2", children: [
          /* @__PURE__ */ e(P, { className: "h-4 w-4 text-[var(--color-accent-600)] flex-shrink-0 mt-0.5" }),
          /* @__PURE__ */ e("h3", { className: "text-sm font-medium", children: r(`faq.${t}.question`) })
        ] }),
        /* @__PURE__ */ e("p", { className: "text-xs text-[var(--text-muted)] pl-6", children: r(`faq.${t}.answer`) })
      ] }, `faq-${t}`)) })
    ] }),
    /* @__PURE__ */ a("section", { children: [
      /* @__PURE__ */ a(
        "button",
        {
          onClick: () => C(!l),
          className: "w-full flex items-center justify-between p-4 rounded-[var(--radius-card)] border border-[var(--border-color)] bg-[var(--bg-card)] hover:bg-[var(--bg-secondary)] transition-colors",
          children: [
            /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
              /* @__PURE__ */ e(B, { className: "h-4 w-4 text-[var(--text-muted)]" }),
              /* @__PURE__ */ e("span", { className: "text-sm font-semibold", children: r("sections.techRef") })
            ] }),
            /* @__PURE__ */ e(o, { className: `h-4 w-4 text-[var(--text-muted)] transition-transform ${l ? "rotate-90" : ""}` })
          ]
        }
      ),
      l && /* @__PURE__ */ a("div", { className: "mt-2 border border-[var(--border-color)] rounded-lg bg-[var(--bg-card)] divide-y divide-[var(--border-color)]", children: [
        /* @__PURE__ */ a("div", { className: "p-4", children: [
          /* @__PURE__ */ e("h3", { className: "text-sm font-semibold mb-3", children: r("techRef.rulesTitle") }),
          /* @__PURE__ */ e("div", { className: "space-y-2", children: X.map((t) => /* @__PURE__ */ a("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)] text-xs", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center gap-2 mb-1 min-w-0", children: [
              /* @__PURE__ */ e("span", { className: "font-mono text-[var(--color-accent-600)] break-all", children: t.id }),
              /* @__PURE__ */ e("span", { className: "px-1.5 py-0.5 rounded bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)]", children: t.category })
            ] }),
            /* @__PURE__ */ e("p", { className: "text-[var(--text-muted)]", children: r(t.key) })
          ] }, t.id)) })
        ] }),
        /* @__PURE__ */ a("div", { className: "p-4", children: [
          /* @__PURE__ */ e("h3", { className: "text-sm font-semibold mb-3", children: r("techRef.permissionsTitle") }),
          /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ a("table", { className: "w-full text-xs", children: [
            /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { className: "border-b border-[var(--border-color)]", children: [
              /* @__PURE__ */ e("th", { className: "text-left py-2 px-2 text-[var(--text-muted)] font-medium", children: "Permission" }),
              /* @__PURE__ */ e("th", { className: "text-left py-2 px-2 text-[var(--text-muted)] font-medium", children: "Description" })
            ] }) }),
            /* @__PURE__ */ e("tbody", { children: /* @__PURE__ */ a("tr", { className: "border-b border-[var(--border-color)]", children: [
              /* @__PURE__ */ e("td", { className: "py-2 px-2 min-w-0", children: /* @__PURE__ */ e("span", { className: "font-mono text-[var(--color-accent-600)] break-all", children: "administration.users.read" }) }),
              /* @__PURE__ */ e("td", { className: "py-2 px-2 text-[var(--text-muted)]", children: r("techRef.perms.read") })
            ] }) })
          ] }) })
        ] }),
        /* @__PURE__ */ a("div", { className: "p-4", children: [
          /* @__PURE__ */ e("h3", { className: "text-sm font-semibold mb-3", children: r("techRef.endpointsTitle") }),
          /* @__PURE__ */ e("div", { className: "space-y-2", children: O.map((t, d) => /* @__PURE__ */ a("div", { className: "p-2.5 rounded-lg bg-[var(--bg-secondary)] text-xs", children: [
            /* @__PURE__ */ a("div", { className: "flex items-center gap-2 mb-0.5 min-w-0", children: [
              /* @__PURE__ */ e("span", { className: `font-bold px-1.5 py-0.5 rounded border text-xs flex-shrink-0 ${J[t.method]}`, children: t.method }),
              /* @__PURE__ */ a("code", { className: "text-[var(--text-primary)] break-all min-w-0", children: [
                t.path,
                t.params
              ] })
            ] }),
            /* @__PURE__ */ a("div", { className: "text-[var(--text-muted)] pl-1 min-w-0", children: [
              t.handler,
              " · ",
              /* @__PURE__ */ e("span", { className: "font-mono break-all", children: t.permission })
            ] })
          ] }, `ep-${t.method}-${d}`)) })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ a("div", { className: "flex justify-between pt-6 border-t border-[var(--border-color)]", children: [
      /* @__PURE__ */ a(
        n,
        {
          to: "/docs/business/administration/users",
          className: "flex items-center gap-2 text-[var(--text-secondary)] hover:text-[var(--color-accent-600)] transition-colors text-sm",
          children: [
            /* @__PURE__ */ e(b, { className: "w-4 h-4" }),
            r("nav.backToAdmin")
          ]
        }
      ),
      /* @__PURE__ */ a(
        n,
        {
          to: "/docs/business/administration/permissions",
          className: "flex items-center gap-2 text-[var(--color-accent-600)] hover:underline text-sm",
          children: [
            r("nav.toUsersList"),
            /* @__PURE__ */ e(M, { className: "w-4 h-4" })
          ]
        }
      )
    ] })
  ] });
}
export {
  Y as default
};
//# sourceMappingURL=index-Ds8XQcpr.js.map
