:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-soft: #1f2937;
    --panel-border: #374151;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #22c55e;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
    background: radial-gradient(circle at top right, #1f2937, #0b1020 45%, #060b16);
    color: var(--text);
}

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

.auth-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 28px;
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
}

.auth-form {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

label {
    font-size: 13px;
    color: var(--muted);
}

input,
textarea,
button {
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: var(--panel-soft);
    color: var(--text);
    font-size: 14px;
    padding: 11px 12px;
}

button {
    cursor: pointer;
    background: linear-gradient(145deg, #1f9f4a, #22c55e);
    border: none;
    color: #03140b;
    font-weight: 700;
}

button:hover {
    opacity: 0.92;
}

.error-box {
    margin-top: 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
}

.dashboard-body {
    min-height: 100vh;
}

.dashboard-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    gap: 14px;
    padding: 14px;
}

.sidebar,
.chat-main,
.settings-panel {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    backdrop-filter: blur(6px);
}

.sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-top {
    padding: 14px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.small-btn {
    padding: 7px 10px;
    font-size: 12px;
}

.chat-list {
    overflow-y: auto;
    padding: 10px;
}

.chat-item {
    width: 100%;
    text-align: left;
    background: #0b1220;
    border: 1px solid #1f2937;
    color: var(--text);
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 10px;
}

.chat-item.active,
.chat-item:hover {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.chat-item-name {
    font-size: 14px;
    font-weight: 700;
}

.chat-item-preview {
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #1e293b;
}

.logout-btn {
    color: #cbd5e1;
    text-decoration: none;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 8px 12px;
}

.messages-box {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-bubble {
    max-width: 75%;
    background: #0b1220;
    border: 1px solid #223049;
    border-radius: 14px;
    padding: 10px 12px;
}

.message-author {
    color: #86efac;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 600;
}

.message-time {
    color: #94a3b8;
    font-size: 11px;
    margin-top: 7px;
}

.settings-panel {
    padding: 18px;
}

.settings-panel form {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.status-text {
    margin-top: 10px;
    font-size: 13px;
}

.status-text.ok {
    color: #86efac;
}

.status-text.error {
    color: #fda4af;
}

.empty-state {
    color: #94a3b8;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 260px 1fr;
    }

    .settings-panel {
        grid-column: 1 / -1;
    }
}

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