* {
    font-family: "Poppins", sans-serif;
    box-sizing: border-box;
}

body {
    background: linear-gradient(
        180deg,
        #0b6b45 0px,
        #0f7a4d 300px,
        #f4f7f5 300px
    );
    min-height: 100vh;
    padding: 12px;
    margin: 0;
    overflow: hidden;
}

/* MAIN */

.main-wrapper {
    background: white;
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

    height: calc(100vh - 24px);

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

/* HEADER */

.top-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8ece9;
    flex-shrink: 0;
}

.logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.system-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f2d2b;
    margin-bottom: 0;
}

.header-line {
    height: 4px;
    width: 180px;
    background: #0f8a57;
    border-radius: 20px;
    margin-top: 8px;
}

/* ACTION BUTTONS */

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-shrink: 0;
}

.btn-back {
    border: 1px solid #d8e2dc;
    background: white;
    padding: 10px 18px;
    border-radius: 14px;
    font-weight: 500;
    color: #1c5c45;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    transition: 0.3s;
    font-size: 14px;
}

.btn-back:hover {
    background: #f5faf7;
}

.btn-reset-chat {
    border: none;
    background: #ef4444;
    color: white;
    padding: 10px 18px;
    border-radius: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-reset-chat:hover {
    background: #dc2626;
    color: white;
}

/* TITLE */

.page-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #082c2a;
    margin-top: 16px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.page-subtitle {
    text-align: center;
    font-size: 13px;
    color: #667085;
    margin-bottom: 16px;
    line-height: 1.5;
    flex-shrink: 0;
}

/* CHAT CARD */

.chat-card {
    background: white;
    border-radius: 24px;
    border: 1px solid #e7ece8;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);

    display: flex;
    flex-direction: column;

    flex: 1;

    min-height: 0;
    overflow: hidden;
}

/* CHAT BODY */

.chat-body {
    flex: 1;
    min-height: 0;

    overflow-y: auto;

    padding: 25px;

    background: #f9fbfa;

    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* BOT */

.bot-message {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.bot-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0f7a4d;

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

    color: white;
    font-size: 20px;

    flex-shrink: 0;
}

.bot-bubble {
    background: white;
    padding: 18px;

    border-radius: 18px 18px 18px 5px;

    max-width: 75%;

    font-size: 14px;
    line-height: 1.2;

    color: #475467;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);

    border: 1px solid #edf1ee;
}

/* USER */

.user-message {
    display: flex;
    justify-content: flex-end;
}

.user-bubble {
    background: linear-gradient(135deg, #0f8a57, #0b6b45);

    color: white;

    padding: 16px 18px;

    border-radius: 18px 18px 5px 18px;

    max-width: 75%;

    font-size: 14px;
    line-height: 1.2;

    box-shadow: 0 5px 14px rgba(15, 122, 77, 0.18);
}

/* DETAIL BUTTON */

.btn-detail-chat {
    background: linear-gradient(135deg, #11a060, #0c7c4b);

    color: white;
    padding: 8px 14px;
    border-radius: 10px;

    text-decoration: none;

    font-size: 13px;
    font-weight: 600;

    display: inline-block;

    margin-top: 8px;
}

.btn-detail-chat:hover {
    color: white;
}

/* ERROR */

.error-bubble {
    background: #fff4f4;
    border: 1px solid #ffd7d7;
    color: #c0392b;
}

/* FOOTER */

.chat-footer {
    padding: 12px;
    border-top: 1px solid #eef2ef;
    background: white;
    flex-shrink: 0;
}

.chat-form {
    display: flex;
    gap: 14px;
    align-items: center;
}

.chat-input {
    flex: 1;

    border: 1px solid #dce4df;

    border-radius: 16px;

    padding: 10px 14px;
    min-height: 42px;
    font-size: 13px;

    outline: none;
}

.chat-input:focus {
    border-color: #0f8a57;
    box-shadow: 0 0 0 4px rgba(15, 138, 87, 0.1);
}

.btn-send {
    background: linear-gradient(135deg, #11a060, #0c7c4b);

    border: none;

    width: 42px;
    height: 42px;

    border-radius: 16px;

    color: white;
    font-size: 20px;

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

    flex-shrink: 0;
}

/* ALERT */

.alert-custom {
    background: #f1f8f4;
    border: 1px solid #d9ebe0;
    border-radius: 12px;

    padding: 10px 14px;
    margin-top: 12px;

    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-icon {
    width: 20px;
    height: 20px;

    border-radius: 50%;

    background: #1aa567;

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

    color: white;
    font-size: 12px;

    flex-shrink: 0;
}

.alert-text {
    font-size: 12px;
    line-height: 1.4;
    color: #35524c;
    margin: 0;
}

/* MOBILE */

@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .main-wrapper {
        padding: 14px;
        border-radius: 18px;
        height: calc(100vh - 16px);
    }

    .header-line {
        width: 130px;
    }

    .system-title {
        font-size: 16px;
    }

    .top-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .btn-back {
        flex: 1;
        font-size: 13px;
        padding: 10px 12px;
    }

    .btn-reset-chat {
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 12px;
        flex-shrink: 0;
    }

    .btn-reset-chat span {
        display: none;
    }

    .btn-reset-chat i {
        margin: 0;
        font-size: 16px;
    }

    .page-title {
        font-size: 18px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .chat-body {
        padding: 14px;
    }

    .bot-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .bot-bubble,
    .user-bubble {
        max-width: 88%;
        font-size: 13px;
        line-height: 1.6;
        padding: 12px;
    }

    .chat-footer {
        padding: 12px;
    }

    .chat-form {
        gap: 8px;
    }

    .chat-input {
        font-size: 14px;
        padding: 12px 14px;
    }

    .btn-send {
        width: 48px;
        height: 48px;
        font-size: 16px;
        border-radius: 12px;
    }

    .alert-custom {
        padding: 10px;
    }

    .alert-text {
        font-size: 12px;
    }
}
