:root {
    --bg: #020807;
    --panel: #071b12;
    --panel2: #0d2b1c;
    --green: #39ff88;
    --green2: #7dffb2;
    --text: #d7ffe5;
    --muted: #8bcca4;
    --danger: #ff4f6d;
    --yellow: #ffd166;
    --blue: #7dd3fc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #0b2717, var(--bg) 55%);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    min-height: 100vh;
}

.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, .025) 50%, transparent 50%);
    background-size: 100% 4px;
    mix-blend-mode: overlay;
}

.topbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(57, 255, 136, .25);
    background: rgba(2, 8, 7, .85);
    position: sticky;
    top: 0;
    z-index: 5;
}

.brand {
    color: var(--green);
    font-weight: 800;
    letter-spacing: .04em;
}

.status {
    color: var(--muted);
    font-size: .9rem;
}

.dot {
    display: inline-block;
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
    margin-right: .4rem;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.login-card,
.panel {
    background: linear-gradient(145deg, rgba(7, 27, 18, .96), rgba(13, 43, 28, .88));
    border: 1px solid rgba(57, 255, 136, .35);
    box-shadow: 0 0 35px rgba(57, 255, 136, .1), inset 0 0 25px rgba(57, 255, 136, .04);
    border-radius: 18px;
    padding: 1.5rem;
}

.login-card {
    max-width: 520px;
    margin: 3rem auto;
}

h1,
h2 {
    color: var(--green);
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

.tiny {
    font-size: .8rem;
}

.alert {
    background: rgba(255, 79, 109, .12);
    border: 1px solid rgba(255, 79, 109, .45);
    color: #ffd3dc;
    border-radius: 12px;
    padding: .75rem;
    margin: 1rem 0;
}

.login-form {
    display: grid;
    gap: .65rem;
}

input {
    background: #001f12;
    color: var(--text);
    border: 1px solid rgba(57, 255, 136, .35);
    border-radius: 12px;
    padding: .85rem 1rem;
    outline: none;
}

input:focus {
    box-shadow: 0 0 0 3px rgba(57, 255, 136, .18);
}

button {
    background: var(--green);
    color: #00170c;
    border: 0;
    border-radius: 12px;
    padding: .85rem 1rem;
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.1);
}

button.small {
    padding: .45rem .75rem;
    font-size: .85rem;
}

button.danger {
    background: var(--danger);
    color: white;
}

.hint {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, .25);
    border-radius: 12px;
}

code {
    color: var(--green2);
}

.panel-head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid rgba(57, 255, 136, .2);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.badge,
.flag-box {
    border: 1px solid rgba(57, 255, 136, .35);
    color: var(--green2);
    padding: .7rem 1rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, .25);
}

.flag-box {
    border-radius: 12px;
    font-weight: 900;
}

.messages {
    height: 55vh;
    overflow: auto;
    padding: 1rem;
    background: rgba(0, 0, 0, .3);
    border-radius: 14px;
    border: 1px solid rgba(57, 255, 136, .2);
}

.msg {
    margin: .85rem 0;
    max-width: 80%;
    padding: .8rem;
    border-radius: 14px;
    border: 1px solid rgba(57, 255, 136, .2);
}

.msg.player {
    margin-left: auto;
    background: rgba(57, 255, 136, .08);
}

.msg.support {
    margin-right: auto;
    background: rgba(125, 255, 178, .14);
}

.meta {
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: .35rem;
}

.text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.send-form {
    display: flex;
    gap: .75rem;
    margin-top: 1rem;
}

.send-form input {
    flex: 1;
}

/* Support dashboard réaliste */

.support-panel {
    min-height: 75vh;
}

.support-layout {
    display: grid;
    grid-template-columns: 390px minmax(0, 1fr);
    gap: 1rem;
}

.support-sidebar {
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(57, 255, 136, .18);
    border-radius: 16px;
    padding: 1rem;
    min-height: 62vh;
}

.support-sidebar-head {
    border-bottom: 1px solid rgba(57, 255, 136, .18);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
}

.ticket-list {
    display: grid;
    gap: .75rem;
}

.ticket-card {
    display: block;
    text-decoration: none;
    color: var(--text);
    padding: .9rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(57, 255, 136, .18);
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.ticket-card:hover {
    transform: translateY(-1px);
    border-color: rgba(57, 255, 136, .55);
    background: rgba(57, 255, 136, .07);
}

.ticket-card.active {
    border-color: var(--green);
    box-shadow: 0 0 18px rgba(57, 255, 136, .15);
    background: rgba(57, 255, 136, .11);
}

.ticket-card-top {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
    margin-bottom: .5rem;
}

.ticket-id {
    color: var(--green);
    font-weight: 900;
}

.ticket-status {
    color: var(--green2);
    border: 1px solid rgba(125, 255, 178, .35);
    border-radius: 999px;
    padding: .2rem .55rem;
    font-size: .75rem;
    background: rgba(125, 255, 178, .08);
}

.ticket-title {
    font-weight: 900;
    margin-bottom: .35rem;
}

.ticket-client {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: .5rem;
}

.ticket-preview {
    color: #c6f8d9;
    font-size: .85rem;
    line-height: 1.35;
    max-height: 2.8em;
    overflow: hidden;
    opacity: .9;
    margin-bottom: .6rem;
}

.ticket-meta-row {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    color: var(--muted);
    font-size: .72rem;
}

.conversation-pane {
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(57, 255, 136, .18);
    border-radius: 16px;
    padding: 1rem;
    min-height: 62vh;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(57, 255, 136, .18);
}

.conversation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.mini-badge {
    border: 1px solid rgba(57, 255, 136, .35);
    color: var(--green2);
    padding: .4rem .7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, .2);
    font-size: .8rem;
    font-weight: 800;
}

.mini-badge.priority {
    color: var(--yellow);
    border-color: rgba(255, 209, 102, .4);
}

.ticket-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.ticket-details > div {
    border: 1px solid rgba(57, 255, 136, .16);
    border-radius: 12px;
    padding: .75rem;
    background: rgba(0, 0, 0, .22);
    min-width: 0;
}

.detail-label {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.conversation-thread {
    height: 45vh;
    overflow: auto;
    border: 1px solid rgba(57, 255, 136, .16);
    border-radius: 14px;
    background: rgba(0, 0, 0, .22);
    padding: 1rem;
}

.support-message {
    display: flex;
    gap: .75rem;
    margin: 1rem 0;
}

.support-message.player {
    flex-direction: row-reverse;
}

.support-message-avatar {
    flex: 0 0 2.2rem;
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(57, 255, 136, .28);
    background: rgba(57, 255, 136, .08);
}

.support-message-body {
    max-width: 78%;
    min-width: 0;
}

.support-message.player .support-message-body {
    text-align: right;
}

.support-message-meta {
    color: var(--muted);
    font-size: .75rem;
    display: flex;
    gap: .5rem;
    justify-content: flex-start;
    margin-bottom: .35rem;
}

.support-message.player .support-message-meta {
    justify-content: flex-end;
}

.support-bubble {
    display: inline-block;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border-radius: 16px;
    padding: .85rem 1rem;
    border: 1px solid rgba(57, 255, 136, .2);
    background: rgba(125, 255, 178, .13);
    line-height: 1.45;
}

.support-message.player .support-bubble {
    background: rgba(57, 255, 136, .08);
    border-color: rgba(57, 255, 136, .28);
}

.reply-box {
    margin-top: 1rem;
    border: 1px dashed rgba(57, 255, 136, .2);
    border-radius: 12px;
    padding: .75rem;
    background: rgba(0, 0, 0, .18);
}

.empty-conversation {
    min-height: 55vh;
    display: grid;
    place-content: center;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Ancienne grille conservée si tu l'utilises ailleurs */

.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 1rem;
}

.session-card {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, .25);
    border: 1px solid rgba(57, 255, 136, .22);
}

.sid {
    color: var(--green);
    font-weight: 900;
    margin-bottom: .4rem;
}

@media (max-width: 1000px) {
    .support-layout {
        grid-template-columns: 1fr;
    }

    .ticket-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .support-message-body {
        max-width: 88%;
    }
}

@media (max-width: 700px) {
    .topbar,
    .panel-head,
    .send-form,
    .conversation-header {
        flex-direction: column;
        align-items: stretch;
    }

    .msg {
        max-width: 100%;
    }

    .ticket-details {
        grid-template-columns: 1fr;
    }

    .support-message-body {
        max-width: 100%;
    }

    .conversation-thread {
        height: 52vh;
    }
}
.support-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1rem;
}

.support-sidebar {
    border-right: 1px solid rgba(57,255,136,.2);
    padding-right: 1rem;
}

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.ticket-card {
    display: block;
    color: inherit;
    text-decoration: none;

    padding: .8rem;
    border-radius: 12px;

    background: rgba(0,0,0,.25);
    border: 1px solid rgba(57,255,136,.15);
}

.ticket-card:hover {
    border-color: rgba(57,255,136,.45);
}

.ticket-card.active {
    border-color: var(--green);
    background: rgba(57,255,136,.08);
}

.ticket-card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.ticket-id {
    color: var(--green);
    font-weight: 700;
}

.ticket-status {
    color: var(--green2);
}

.ticket-title {
    font-weight: 700;
    margin-bottom: .4rem;
}

.ticket-preview {
    color: var(--muted);
    font-size: .85rem;
    margin-top: .4rem;
}

.ticket-meta-row {
    display: flex;
    justify-content: space-between;
    margin-top: .6rem;
    font-size: .75rem;
    color: var(--muted);
}

.conversation-thread {
    height: 60vh;
    overflow-y: auto;
    padding-right: .5rem;
}

.support-message {
    display: flex;
    gap: .8rem;
    margin-bottom: 1rem;
}

.support-message.player {
    flex-direction: row-reverse;
}

.support-message-body {
    max-width: 75%;
}

.support-message-meta {
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: .3rem;
}

.support-message.player .support-message-meta {
    text-align: right;
}

.support-bubble {
    padding: .8rem 1rem;
    border-radius: 12px;
    background: rgba(57,255,136,.08);
    border: 1px solid rgba(57,255,136,.15);
    white-space: pre-wrap;
}

.support-message.player .support-bubble {
    background: rgba(125,255,178,.12);
}

.support-message-avatar {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: rgba(57,255,136,.1);
}

.empty-conversation {
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
