* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

img {
    max-width: 100%;
    height: auto;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    padding: 18px;
}

.login-card {
    width: 360px;
    max-width: 100%;
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 30px 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    text-align: left;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.login-logo {
    width: 82px !important;
    max-width: 82px !important;
    height: auto !important;
    display: block;
    object-fit: contain;
}

.login-card h1 {
    margin: 0;
    color: #0f172a;
    text-align: center;
}

.login-card p {
    margin-top: 6px;
    color: #64748b;
    text-align: center;
}

label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-weight: bold;
}

input,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 11px;
    font-size: 14px;
}

button,
.btn {
    display: inline-block;
    margin-top: 18px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 11px 18px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
}

button:hover,
.btn:hover {
    background: #1d4ed8;
}

.alert-error {
    margin-top: 16px;
    padding: 10px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
}

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

.sidebar {
    width: 250px;
    background: #0f172a;
    color: white;
    padding: 22px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.brand-logo {
    width: 44px !important;
    max-width: 44px !important;
    height: auto !important;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

.brand h2 {
    margin: 0;
    line-height: 1.1;
    font-size: 19px;
}

.brand span {
    color: #93c5fd;
    font-size: 12px;
}

.sidebar a {
    display: block;
    color: #e5e7eb;
    text-decoration: none;
    padding: 12px 0;
}

.sidebar a:hover {
    color: white;
}

.main-content {
    flex: 1;
    padding: 32px;
    min-width: 0;
}

.cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 280px;
    box-shadow: 0 8px 25px rgba(15,23,42,.08);
}

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

.chat-box {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 8px 25px rgba(15,23,42,.08);
}

.msg {
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.45;
}

.msg.user {
    background: #dbeafe;
    margin-left: auto;
}

.msg.assistant {
    background: #f1f5f9;
    margin-right: auto;
}

.msg.pending {
    opacity: .75;
}

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

.chat-form textarea {
    flex: 1;
    resize: none;
}

.chat-form button {
    width: 120px;
    margin-top: 0;
}

@media (max-width: 800px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .main-content {
        padding: 20px;
    }

    .chat-main {
        height: auto;
        min-height: 100vh;
    }

    .chat-box {
        min-height: 55vh;
    }

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

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