/* Chi Tiêu Cá Nhân - Frontend Styles */
.ctcn-chatbot {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(37, 99, 235, 0.15);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ctcn-header {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ctcn-icon {
    font-size: 32px;
}

.ctcn-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.ctcn-subtitle {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 2px;
}

.ctcn-messages {
    height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.ctcn-messages::-webkit-scrollbar { width: 4px; }
.ctcn-messages::-webkit-scrollbar-track { background: transparent; }
.ctcn-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.ctcn-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.ctcn-msg.ctcn-user {
    flex-direction: row-reverse;
}

.ctcn-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.ctcn-bot .ctcn-bubble {
    background: #fff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.ctcn-user .ctcn-bubble {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ctcn-bubble code {
    background: rgba(0,0,0,0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 13px;
}

.ctcn-bubble small {
    opacity: 0.75;
}

.ctcn-bubble.ctcn-thu { border-left: 3px solid #16a34a; }
.ctcn-bubble.ctcn-chi { border-left: 3px solid #dc2626; }
.ctcn-bubble.ctcn-error { border-left: 3px solid #f59e0b; color: #92400e; }

.ctcn-input-area {
    display: flex;
    padding: 12px 16px;
    gap: 10px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.ctcn-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    color: #1e293b;
}

.ctcn-input:focus {
    border-color: #2563eb;
}

.ctcn-send {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 14px;
    width: 52px;
    height: 52px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.ctcn-send:hover { background: #1d4ed8; }
.ctcn-send:active { transform: scale(0.95); }

.ctcn-today-summary {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f0f9ff;
    font-size: 13px;
    font-weight: 600;
    border-top: 1px solid #bfdbfe;
}

.ctcn-today-summary .ctcn-thu { color: #16a34a; }
.ctcn-today-summary .ctcn-chi { color: #dc2626; }
.ctcn-today-summary .ctcn-balance.pos { color: #2563eb; }
.ctcn-today-summary .ctcn-balance.neg { color: #dc2626; }

.ctcn-typing .ctcn-bubble::after {
    content: '...';
    animation: ctcn-dots 1s infinite;
}

.ctcn-login-wall {
    padding: 40px 24px;
    text-align: center;
    background: #f8fafc;
}

.ctcn-login-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.ctcn-login-msg {
    color: #475569;
    font-size: 15px;
    margin-bottom: 20px;
}

.ctcn-btn-login {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 11px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.ctcn-btn-login:hover {
    background: #1d4ed8;
    color: #fff;
}

@keyframes ctcn-dots {
    0%, 20% { content: '.'; }
    40%      { content: '..'; }
    60%, 100%{ content: '...'; }
}
