/* AI Keuangan — Chat Widget */
#aik-chat-wrap {
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

#aik-messages {
    height: 420px;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aik-msg {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.aik-bot {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.aik-user {
    background: #1a73e8;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.aik-typing {
    background: #fff;
    border: 1px solid #e8e8e8;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #999;
    font-style: italic;
    font-size: 13px;
}

/* Confirm buttons */
.aik-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.aik-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: opacity .15s;
}

.aik-btn:hover { opacity: .85; }

.aik-btn-yes  { background: #1a73e8; color: #fff; }
.aik-btn-edit { background: #f1f3f4; color: #3c4043; }
.aik-btn-no   { background: #fce8e6; color: #c5221f; }

/* Input row */
#aik-input-row {
    display: flex;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

#aik-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #dadce0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}

#aik-input:focus { border-color: #1a73e8; }

#aik-send {
    padding: 10px 18px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

#aik-send:hover    { background: #1557b0; }
#aik-send:disabled { background: #bbb; cursor: not-allowed; }

/* Scrollbar */
#aik-messages::-webkit-scrollbar { width: 4px; }
#aik-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ============================================================
   Transaction Table — [aik_transactions]
   ============================================================ */
.aik-tx-wrap {
    width: 100%;
    overflow-x: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.aik-tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.aik-tx-table th {
    background: #f1f3f4;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #3c4043;
    border-bottom: 2px solid #e0e0e0;
}

.aik-tx-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f3f4;
    color: #3c4043;
    vertical-align: middle;
}

.aik-tx-table tr:hover td { background: #fafafa; }

.aik-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.aik-badge-income   { background: #e6f4ea; color: #1e7e34; }
.aik-badge-expense  { background: #fce8e6; color: #c5221f; }
.aik-badge-transfer { background: #e8f0fe; color: #1a73e8; }

.aik-amount-in  { color: #1e7e34; font-weight: 600; }
.aik-amount-out { color: #c5221f; font-weight: 600; }

.aik-empty {
    color: #999;
    font-style: italic;
    padding: 16px 0;
}

/* ============================================================
   Summary Cards — [aik_summary]
   ============================================================ */
.aik-summary-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-bottom: 24px;
}

.aik-summary-title {
    font-size: 16px;
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 12px;
}

.aik-summary-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.aik-card {
    flex: 1;
    min-width: 160px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.aik-card-label  { font-size: 12px; color: #666; margin-bottom: 6px; }
.aik-card-amount { font-size: 20px; font-weight: 700; }

.aik-card-income  { background: #e6f4ea; }
.aik-card-income .aik-card-amount { color: #1e7e34; }

.aik-card-expense { background: #fce8e6; }
.aik-card-expense .aik-card-amount { color: #c5221f; }

.aik-profit-pos { background: #e8f0fe; }
.aik-profit-pos .aik-card-amount { color: #1a73e8; }

.aik-profit-neg { background: #fff3e0; }
.aik-profit-neg .aik-card-amount { color: #e65100; }
