/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0f172a;
    --surface:   #1e293b;
    --surface2:  #273549;
    --border:    #334155;
    --text:      #e2e8f0;
    --muted:     #94a3b8;
    --primary:   #3b82f6;
    --primary-h: #2563eb;
    --success:   #22c55e;
    --danger:    #ef4444;
    --warning:   #f59e0b;
    --radius:    8px;
    --sidebar-w: 220px;
}

html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    display: flex;
}

a { color: var(--primary); text-decoration: none; }

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform .25s ease;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 199;
}
.sidebar-backdrop.visible { display: block; }

.topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    flex: 1;
}

.hamburger {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: var(--radius);
}
.hamburger:hover { background: var(--surface2); }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--muted);
    transition: background .15s, color .15s;
    border-radius: 0;
}

.sidebar-nav li a svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: var(--surface2);
    color: var(--text);
}

.sidebar-nav li a.active { color: var(--primary); border-left: 2px solid var(--primary); }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    transition: color .15s;
}
.sidebar-user:hover, .sidebar-user.active { color: var(--text); }

.btn-logout {
    display: flex;
    align-items: center;
    color: var(--muted);
    transition: color .15s;
}
.btn-logout:hover { color: var(--danger); }

/* ── Main ──────────────────────────────────────────────────────── */
.main {
    margin-left: var(--sidebar-w);
    padding: 28px 32px;
    flex: 1;
    min-height: 100vh;
    overflow-y: auto;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.page-header h1 { font-size: 22px; font-weight: 700; }

.badge {
    background: var(--surface2);
    color: var(--muted);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
}

.badge-you {
    background: var(--surface2);
    color: var(--muted);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-style: italic;
}

/* ── Stats ─────────────────────────────────────────────────────── */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 28px;
    min-width: 110px;
    text-align: center;
}

.stat-value { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ── Sysinfo ───────────────────────────────────────────────────── */
.sysinfo-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.sysinfo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.sysinfo-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: 6px;
}

.sysinfo-values {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

.sysinfo-pct {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.sysinfo-sub {
    font-size: 11px;
    color: var(--muted);
}

.sysinfo-bar-wrap {
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
}

.sysinfo-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: var(--success);
    transition: width .5s ease, background .5s ease;
}

/* ── Server Grid ───────────────────────────────────────────────── */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.server-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color .2s, opacity .2s;
}

.server-card.active  { border-left: 3px solid var(--success); }
.server-card.inactive{ border-left: 3px solid var(--border); }
.server-card.looping { border-left: 3px solid var(--warning); }
.server-card.failed  { border-left: 3px solid var(--danger); }
.server-card.loading { opacity: .6; pointer-events: none; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.server-name { font-weight: 600; font-size: 15px; }
.server-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

.player-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: rgba(34,197,94,.13);
    border-radius: 10px;
    padding: 2px 7px;
    white-space: nowrap;
    line-height: 1.4;
}
.player-badge.empty {
    color: var(--muted);
    background: transparent;
    font-weight: 400;
}
.player-badge:empty { display: none; }

.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.server-card.active   .status-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.server-card.inactive .status-dot { background: var(--border); }
.server-card.looping  .status-dot { background: var(--warning); box-shadow: 0 0 6px var(--warning); animation: pulse-dot 1s ease-in-out infinite; }
.server-card.failed   .status-dot { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }

.server-status {
    font-size: 12px;
    margin-bottom: 14px;
}
.server-card.active   .server-status { color: var(--success); }
.server-card.inactive .server-status { color: var(--muted); }
.server-card.looping  .server-status { color: var(--warning); }
.server-card.failed   .server-status { color: var(--danger); }

.server-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, opacity .15s;
    text-decoration: none;
    color: #fff;
}

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

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 10px; }

.btn-primary   { background: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-h); }

.btn-success   { background: #15803d; }
.btn-success:hover:not(:disabled) { background: var(--success); }

.btn-danger    { background: #b91c1c; }
.btn-danger:hover:not(:disabled) { background: var(--danger); }

.btn-warning   { background: #b45309; }
.btn-warning:hover:not(:disabled) { background: var(--warning); }

.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"],
select,
textarea {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group-inline label { margin: 0; white-space: nowrap; }
.form-group-inline select,
.form-group-inline input { width: auto; }

/* ── Alert ─────────────────────────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-danger { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }

/* ── Login ─────────────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    width: 340px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 28px;
    justify-content: center;
}

/* ── Editor ────────────────────────────────────────────────────── */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.tab-bar { display: flex; gap: 4px; }
.tab {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    cursor: pointer;
    padding: 5px 12px;
    font-size: 13px;
    transition: background .15s, color .15s;
}
.tab:hover { background: var(--surface2); color: var(--text); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.editor-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--muted);
    padding: 4px 2px 8px;
    font-family: monospace;
}

.editor-wrap { height: calc(100vh - 240px); }

/* ── Logs ──────────────────────────────────────────────────────── */
.log-wrap { height: calc(100vh - 240px); overflow-y: auto; }
.log-output {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: #e6edf3;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 16px;
    min-height: 100%;
    white-space: pre-wrap;
    word-break: break-all;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
}

/* ── Colors ────────────────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--muted); }
.text-primary { color: var(--primary); }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn .2s ease;
    max-width: 320px;
}
.toast.hidden  { display: none; }
.toast.success { background: #15803d; color: #fff; }
.toast.error   { background: #b91c1c; color: #fff; }

@keyframes slideIn {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* ── Sidebar section label ─────────────────────────────────────── */
.sidebar-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--border);
    padding: 16px 16px 4px;
    list-style: none;
}

/* ── Cards / Tables ────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}
.mb-24 { margin-bottom: 24px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover > td { background: var(--surface2); }

.actions-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.role-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 4px 8px;
    font-size: 12px;
    width: auto;
}

/* ── Permissions matrix ────────────────────────────────────────── */
.perms-row.hidden { display: none; }
.perms-row > td { padding: 0; background: var(--bg); }

.perms-panel { padding: 16px 20px; }
.perms-loading { color: var(--muted); font-size: 13px; padding: 12px 0; }

.perms-matrix-wrap { overflow-x: auto; }

.perms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 16px;
}
.perms-table th {
    padding: 6px 10px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-align: center;
}
.perms-table th:first-child { text-align: left; }
.perms-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.perms-table td.inst-name { text-align: left; font-family: monospace; color: var(--text); }
.perms-table tbody tr:hover td { background: var(--surface2); }

.perm-cell input[type=checkbox] {
    width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary);
}

.perms-footer { display: flex; gap: 10px; }

.btn-link {
    background: none; border: none; color: var(--muted);
    cursor: pointer; font-size: 11px; padding: 2px 6px;
    text-decoration: underline;
}
.btn-link:hover { color: var(--text); }

.new-user-form .form-group-inline input,
.new-user-form .form-group-inline select { width: auto; }

/* ── Profile ───────────────────────────────────────────────────── */
.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    max-width: 480px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-name { font-weight: 600; font-size: 16px; }
.profile-role { color: var(--muted); font-size: 13px; margin-top: 2px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 0 0 24px; }

.section-title { font-size: 15px; font-weight: 600; margin-bottom: 18px; }

.password-form { display: flex; flex-direction: column; gap: 4px; }

.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; display: block; }

.alert-success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.3); color: #86efac; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0,0,0,.4);
    }
    .sidebar.open { transform: translateX(0); }

    .topbar { display: flex; }

    .main {
        margin-left: 0;
        padding: 72px 16px 24px;
    }

    .server-grid {
        grid-template-columns: 1fr;
    }

    .sysinfo-row {
        grid-template-columns: 1fr;
    }

    .stats-row {
        gap: 10px;
    }

    .stat-card {
        padding: 14px 16px;
        min-width: 80px;
    }

    .editor-toolbar {
        gap: 8px;
    }

    .tab-bar {
        flex-wrap: wrap;
    }

    .editor-wrap,
    .log-wrap {
        height: calc(100vh - 290px);
    }

    .profile-card {
        padding: 20px 16px;
    }

    .card {
        padding: 16px;
    }

    .data-table th:nth-child(1),
    .data-table td:nth-child(1),
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        display: none;
    }

    .new-user-form .form-group-inline {
        flex-wrap: wrap;
    }
    .new-user-form .form-group-inline input,
    .new-user-form .form-group-inline select {
        width: 100%;
    }

    .perms-table th,
    .perms-table td {
        padding: 4px 6px;
        font-size: 11px;
    }
}

/* ── Barre de filtres ──────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-toggles {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.filter-btn {
    background: none;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    padding: 6px 14px;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.filter-btn:last-child { border-right: none; }
.filter-btn:hover { background: var(--surface2); color: var(--text); }
.filter-btn.active { background: var(--primary); color: #fff; }

.filter-search-wrap {
    position: relative;
    flex: 1;
    min-width: 160px;
    max-width: 280px;
}
.filter-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.filter-search {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    padding: 6px 10px 6px 32px !important;
    outline: none;
    box-sizing: border-box;
}
.filter-search:focus { border-color: var(--primary); }
.filter-search::placeholder { color: var(--muted); }

.filter-count {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 300;
}
.modal-backdrop.visible { display: block; }

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    opacity: 0;
    pointer-events: none;
    z-index: 301;
    width: min(580px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    transition: opacity .18s ease, transform .18s ease;
}
.modal.open {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 600; margin: 0; }
.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }

.modal-body {
    padding: 20px;
    overflow-y: auto;
}
.modal-loading { color: var(--muted); font-size: 14px; }

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.details-section { display: flex; flex-direction: column; gap: 4px; }
.details-section-full { grid-column: 1 / -1; }
.details-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}
.details-value { font-size: 14px; font-weight: 500; }
.details-sub { font-size: 12px; color: var(--muted); }

.player-list {
    list-style: none;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
}
.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background: var(--surface2);
    border-radius: 6px;
    font-size: 13px;
    gap: 8px;
}
.player-spec { opacity: .65; }
.player-nick { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-login { font-size: 11px; flex-shrink: 0; }

.btn-info { background: #0e7490; color: #fff; }
.btn-info:hover { background: #0891b2; }
.btn-chat { background: #6d28d9; color: #fff; }
.btn-chat:hover { background: #7c3aed; }

/* ── Modal chat ────────────────────────────────────────────────── */
.modal-chat { width: min(780px, calc(100vw - 32px)); }

.chat-modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    padding: 12px 16px;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-line {
    font-size: 13px;
    line-height: 1.5;
    padding: 3px 6px;
    border-radius: 4px;
    word-break: break-word;
}

.chat-server {
    color: var(--muted);
    font-style: italic;
    font-size: 12px;
}

.chat-player {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-style: normal;
}
.chat-player:hover { background: var(--surface2); }

.chat-nick {
    font-weight: 600;
    font-style: normal;
    flex-shrink: 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-nick * { font-style: normal !important; }

.chat-login-fallback {
    font-weight: 600;
    font-style: normal;
    color: var(--muted);
    flex-shrink: 0;
}

.chat-sep { color: var(--muted); font-size: 11px; flex-shrink: 0; font-style: normal; }

.chat-msg { color: var(--text); flex: 1; font-style: normal; }

.chat-empty {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 40px 0;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.chat-input-row input.chat-input {
    flex: 1;
    width: auto;
    min-width: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
}
.chat-input-row input.chat-input:focus { border-color: var(--primary); }
.chat-input-row input.chat-input::placeholder { color: var(--muted); }
.chat-input-row .btn { flex-shrink: 0; }

.chat-refresh-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

/* ── Aperçu pseudo (profil) ────────────────────────────────────── */
.nick-preview {
    background: #080e1d;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    min-height: 21px;
    word-break: break-word;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
