:root {
    --bg: #0f172a;
    --panel: #1e293b;
    --panel-light: #273449;
    --text: #e2e8f0;
    --accent: #3b82f6;
    --border: #334155;
}

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

body {
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    padding: 24px;
}

.logo {
    margin-bottom: 40px;
}

.logo-title {
    font-size: 24px;
    font-weight: 700;
}

.logo-subtitle {
    color: #94a3b8;
    font-size: 14px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar a {
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 10px;
    transition: 0.2s;
}

.sidebar a:hover {
    background: var(--panel-light);
}

.content {
    flex: 1;
    padding: 30px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* =========================
   TABLES
========================= */

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    min-width: 1800px;
}

th {
    background: var(--panel-light);
    padding: 12px;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

td {
    padding: 12px;
    border-top: 1px solid var(--border);
    white-space: nowrap;
}

tr:hover {
    background: rgba(255,255,255,0.03);
}

/* =========================
   CHAT
========================= */

.messenger {
    display: flex;
    flex-direction: column;
    gap: 14px;

    background: var(--panel);
    border: 1px solid var(--border);

    border-radius: 16px;

    padding: 20px;

    margin-bottom: 20px;

    min-height: 500px;
}

.message {
    display: flex;
    flex-direction: column;

    width: fit-content;
    max-width: 75%;

    padding: 12px 16px;

    border-radius: 18px;

    word-break: break-word;
}

.message.other,
.message.me {
    align-self: flex-start;

    background: #334155;

    color: white;

    border-bottom-left-radius: 6px;
}

.message.player {
    align-self: flex-end;

    background: var(--accent);

    color: white;

    border-bottom-right-radius: 6px;
}

.message-author {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 4px;
}

.message-text {
    line-height: 1.5;
}

.message-time {
    margin-top: 6px;
    font-size: 11px;
    opacity: 0.65;
    text-align: right;
}

.chat-form {
    display: flex;
    gap: 12px;
}

.chat-form input {
    flex: 1;
}

/* =========================
   FORMS
========================= */

input {
    background: var(--panel);
    color: white;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 10px;
}

button {
    background: var(--accent);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

/* =========================
   PAGINATION
========================= */

.pagination {
    margin-top: 20px;

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 20px;
}

.pagination a {
    color: var(--accent);
    text-decoration: none;
}

/* =========================
   LOGIN
========================= */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: 400px;
    background: var(--panel);
    padding: 30px;
    border-radius: 16px;
}

.login-card h1 {
    margin-bottom: 10px;
}

.login-card p {
    color: #94a3b8;
    margin-bottom: 20px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.error-box {
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
}

/* =========================
   MOBILE MENU
========================= */

.mobile-menu {
    display: none;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .sidebar {
        position: fixed;

        left: -280px;
        top: 0;

        width: 260px;
        height: 100%;

        z-index: 100;

        transition: 0.3s;
    }

    .sidebar.open {
        left: 0;
    }

    .mobile-menu {
        display: block;
        margin-bottom: 20px;
    }

    .content {
        padding: 15px;
    }

    .messenger {
        min-height: 350px;
        padding: 14px;
    }

    .message {
        max-width: 90%;
    }

    .chat-form {
        flex-direction: column;
    }

    .chat-form button {
        width: 100%;
    }

    .login-card {
        width: 95%;
    }
}

.chat-image {

    margin-top: 10px;

    max-width: 250px;

    border-radius: 12px;

    cursor: pointer;

    border: 1px solid var(--border);

    transition: 0.2s;
}

.chat-image:hover {

    transform: scale(1.02);
}

.chat-audio {

    margin-top: 10px;

    width: 250px;
}

.image-modal {

    display: none;

    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.92);

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

    z-index: 9999;
}

.image-modal img {

    max-width: 95%;

    max-height: 95%;

    border-radius: 12px;
}

.close-modal {

    position: absolute;

    top: 20px;

    right: 30px;

    font-size: 42px;

    color: white;

    cursor: pointer;
}

.chat-header {

    display: flex;

    align-items: center;

    margin-bottom: 20px;

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 18px;

    padding: 16px 20px;
}

.chat-user {

    display: flex;

    align-items: center;

    gap: 14px;
}

.chat-avatar {

    width: 48px;

    height: 48px;

    border-radius: 50%;

    background: var(--accent);

    display: flex;

    align-items: center;

    justify-content: center;

    font-weight: 700;
}

.chat-name {

    font-weight: 700;
}

.chat-status {

    color: #22c55e;

    font-size: 13px;

    margin-top: 3px;
}

.messenger {

    height: 65vh;

    overflow-y: auto;

    scroll-behavior: smooth;
}

.fade-in {

    animation: fadeIn .25s ease;
}

@keyframes fadeIn {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {

    display: none;
}

.typing-indicator {

    margin-bottom: 16px;
}

.typing-box {

    width: fit-content;
}

.typing-dots {

    display: flex;

    gap: 5px;
}

.typing-dots span {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background: white;

    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {

    animation-delay: .2s;
}

.typing-dots span:nth-child(3) {

    animation-delay: .4s;
}

@keyframes typing {

    0%,
    60%,
    100% {

        transform: translateY(0);
        opacity: .5;
    }

    30% {

        transform: translateY(-5px);
        opacity: 1;
    }
}