/* ──────────────────────────────────────────────────────────────────────────
   Users.html — thème clair
   ────────────────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
body {
    margin: 0;
    background: #f8fafc;
    color: #0f172a;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}
.logo-icon {
    font-size: 32px;
    width: 52px; height: 52px;
    display: grid; place-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
}
header h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #0f172a;
}
.subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* ── Toolbar ────────────────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-wrap:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.search-wrap .icon { color: #94a3b8; margin-right: 6px; font-size: 12px; }
.search-wrap input {
    background: transparent;
    border: none;
    outline: none;
    color: #0f172a;
    font-size: 12px;
    padding: 7px 0;
    min-width: 200px;
    font-family: inherit;
}
.search-wrap input::placeholder { color: #94a3b8; }
.search-wrap input[id="filterLetter"] {
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
    font-weight: bold;
    font-family: Consolas, monospace;
}

.count-badge {
    margin-left: auto;
    padding: 6px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e40af;
    font-size: 12px;
}
.count-badge b { color: #0f172a; }

.export-btn {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.15s;
}
.export-btn:hover { background: #d1fae5; border-color: #34d399; }

/* ── Layout principal ───────────────────────────────────────────────────── */
.users-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    height: calc(100vh - 190px);
    overflow: hidden;
}

.users-table-wrap {
    overflow: auto;
    background: #f8fafc;
}
.user-detail {
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    overflow-y: auto;
    padding: 0;
}

/* ── Table ──────────────────────────────────────────────────────────────── */
table#usersTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #ffffff;
}
#usersTable thead {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    z-index: 5;
}
#usersTable th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
    position: relative;
}
#usersTable th:hover { color: #1e40af; background: #eff6ff; }
#usersTable th.num { text-align: right; }
#usersTable th.modif { color: #dc2626; }
#usersTable th.read  { color: #2563eb; }
#usersTable th.sort-asc::after  { content: ' ▲'; font-size: 9px; }
#usersTable th.sort-desc::after { content: ' ▼'; font-size: 9px; }

#usersTable td {
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f7;
}
#usersTable td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: Consolas, monospace; }
#usersTable td.num.modif { color: #dc2626; }
#usersTable td.num.read  { color: #2563eb; }
#usersTable td .muted { color: #cbd5e1; }

#usersTable tr { cursor: pointer; transition: background 0.1s; }
#usersTable tbody tr:hover { background: #eff6ff; }
#usersTable tr.selected { background: #fff7ed !important; }
#usersTable tr.selected td { color: #9a3412; }

.cell-display { color: #0f172a; font-weight: 500; }
.cell-login { font-family: Consolas, monospace; color: #64748b; font-size: 11px; }

#emptyState {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
#emptyState .big { font-size: 48px; margin-bottom: 12px; }

/* ── Panneau de détail ──────────────────────────────────────────────────── */
.detail-empty {
    display: grid;
    place-items: center;
    height: 100%;
    color: #94a3b8;
    gap: 12px;
    text-align: center;
}
.detail-empty .big-icon { font-size: 48px; opacity: 0.5; }

.detail-head {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}
.detail-display { font-size: 17px; font-weight: 600; color: #0f172a; }
.detail-login { font-family: Consolas, monospace; font-size: 12px; color: #64748b; margin-top: 3px; }
.detail-desc {
    font-size: 12px;
    color: #475569;
    margin-top: 6px;
    font-style: italic;
    line-height: 1.4;
}
.detail-sid { font-family: Consolas, monospace; font-size: 10px; color: #94a3b8; margin-top: 4px; word-break: break-all; }
.detail-dn  { font-family: Consolas, monospace; font-size: 10px; color: #cbd5e1; margin-top: 4px; word-break: break-all; line-height: 1.4; }

.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #e2e8f0;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
}
.stat { padding: 12px 8px; background: #ffffff; text-align: center; }
.stat-n { font-size: 20px; font-weight: bold; color: #0f172a; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 10px; text-transform: uppercase; color: #64748b; letter-spacing: 0.5px; margin-top: 2px; }
.stat.modif .stat-n { color: #dc2626; }
.stat.read  .stat-n { color: #2563eb; }

.detail-section { padding: 16px 20px; border-bottom: 1px solid #eef2f7; }
.detail-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-count {
    display: inline-block;
    padding: 1px 7px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 10px;
    color: #475569;
}

.detail-section.modif .detail-section-title { color: #dc2626; }
.detail-section.read  .detail-section-title { color: #2563eb; }
.detail-section.grp   .detail-section-title { color: #059669; }
.detail-section.map   .detail-section-title { color: #0e7490; }

.detail-section.modif .detail-count { background: #fee2e2; color: #991b1b; }
.detail-section.read  .detail-count { background: #dbeafe; color: #1e40af; }
.detail-section.grp   .detail-count { background: #dcfce7; color: #166534; }
.detail-section.map   .detail-count { background: #cffafe; color: #155e75; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.link-grp {
    display: inline-block;
    padding: 3px 8px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    color: #047857;
    font-size: 11px;
    font-family: Consolas, monospace;
    text-decoration: none;
    transition: all 0.1s;
}
.link-grp:hover { background: #d1fae5; border-color: #34d399; }

.map-row {
    padding: 6px 10px;
    background: #ecfeff;
    border-left: 2px solid #0891b2;
    margin-bottom: 4px;
    font-size: 11px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}
.map-letter { color: #0891b2; font-weight: bold; font-family: Consolas, monospace; }
.map-path { color: #0f172a; word-break: break-all; flex: 1; min-width: 200px; }
.map-label { color: #64748b; font-size: 10px; }

.path-row {
    padding: 4px 10px;
    margin-bottom: 2px;
    border-left: 2px solid;
    font-size: 11px;
    word-break: break-all;
}
.path-row.modif { background: #fef2f2; border-left-color: #dc2626; color: #991b1b; }
.path-row.read  { background: #eff6ff; border-left-color: #3b82f6; color: #1e40af; }
.mono { font-family: Consolas, monospace; }
.muted { color: #94a3b8; font-style: italic; font-size: 11px; }

/* ── Scrollbars discrètes ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

tr.row-disabled { opacity: 0.55; }
tr.row-disabled .cell-display { text-decoration: line-through; color: #94a3b8; }

.detail-disabled {
    display: inline-block;
    padding: 3px 10px;
    margin-top: 6px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #991b1b;
    font-size: 11px;
    font-weight: 600;
}