/* ============================================================
   MoneyFlow - Custom Styles (Purple theme #9c27b0)
   หมายเหตุ: เขียนเป็น CSS ธรรมดา (ไม่มี @apply) เพราะใช้งานกับ
   Tailwind Play CDN ซึ่งไม่ประมวลผลไฟล์ CSS ภายนอก
   ============================================================ */

:root {
    --brand-600: #9c27b0;
    --brand-700: #7b1fa2;
    --brand-900: #4a148c;
}

/* Scrollbar สวยงาม */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f3f7;
}
::-webkit-scrollbar-thumb {
    background: #d8b4fe;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #c084fc;
}

/* Smooth hover สำหรับการ์ด */
.stat-card {
    transition: transform .25s ease, box-shadow .25s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -15px rgba(74, 14, 95, 0.25);
}

/* Gradient text สำหรับตัวเลขหลัก */
.gradient-text {
    background: linear-gradient(135deg, #9c27b0 0%, #d946ef 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ปุ่มหลัก */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .75rem;
    background-color: #9c27b0;
    padding: .625rem 1rem;
    font-size: .875rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(156, 39, 176, .3), 0 4px 6px -4px rgba(156, 39, 176, .3);
    transition: all .2s ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary:hover {
    background-color: #7b1fa2;
    box-shadow: 0 10px 15px -3px rgba(123, 31, 162, .4), 0 4px 6px -4px rgba(123, 31, 162, .4);
}
.btn-primary:active { transform: scale(.95); }

/* ปุ่มรอง */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .75rem;
    background-color: #fff;
    padding: .625rem 1rem;
    font-size: .875rem;
    font-weight: 600;
    color: #7b1fa2;
    box-shadow: inset 0 0 0 1px #e9d5ff;
    transition: all .2s ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-secondary:hover { background-color: #faf5ff; }
.btn-secondary:active { transform: scale(.95); }

/* ปุ่มลบ */
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .75rem;
    background-color: #e11d48;
    padding: .625rem 1rem;
    font-size: .875rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(225, 29, 72, .3);
    transition: all .2s ease;
    cursor: pointer;
}
.btn-danger:hover { background-color: #be123c; }
.btn-danger:active { transform: scale(.95); }

/* Segment (ปุ่มสลับช่วงเวลา) */
.segment-btn {
    display: inline-block;
    padding: .5rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    border-radius: .75rem;
    transition: all .2s ease;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}
.segment-btn.active {
    background-color: #9c27b0;
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(156, 39, 176, .3);
}
.segment-btn:not(.active) { color: #6b7280; }
.segment-btn:not(.active):hover {
    background-color: #f3e8ff;
    color: #6a1b9a;
}

/* ตาราง */
.table-row {
    transition: background-color .15s ease;
}
.table-row:hover {
    background-color: #faf5ff;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 999px;
    padding: .25rem .625rem;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Input */
.input-field {
    display: block;
    width: 100%;
    border-radius: .75rem;
    border: 0;
    padding: .625rem .875rem;
    font-size: .875rem;
    color: #1f2937;
    background-color: #fff;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    transition: all .2s ease;
}
.input-field::placeholder { color: #9ca3af; }
.input-field:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #9c27b0;
}

/* Toast */
.toast {
    animation: toastIn .4s cubic-bezier(.21, 1.02, .73, 1) forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-16px) scale(.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* กระตุกเล็กน้อย */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-up {
    animation: fadeUp .5s ease forwards;
}

/* Modal */
.modal-backdrop {
    background: rgba(46, 10, 78, 0.5);
    backdrop-filter: blur(4px);
}

/* Pie chart tooltip ปรับสวย */
.chart-tooltip {
    font-family: 'Prompt', sans-serif !important;
    font-size: 12px !important;
}

/* ตัวเลขสถิติใหญ่ */
.big-number {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
