/* =============================================
   Saku-KU - Custom Styles
   ============================================= */

:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --success: #2ec4b6;
    --warning: #ff9f1c;
    --danger: #e63946;
    --bg-body: #f0f2f5;
}

* {
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-body);
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}

.navbar-brand {
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

/* Cards */
.card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.card-summary {
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
}

/* Summary Icon */
.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Progress Bar */
.progress-custom {
    border-radius: 12px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-custom .progress-bar {
    border-radius: 12px;
    transition: width 0.6s ease;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.04);
}

/* Category Badges */
.badge-category {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-makanan { background-color: #fff3cd; color: #856404; }
.badge-transportasi { background-color: #d1ecf1; color: #0c5460; }
.badge-belanja { background-color: #f8d7da; color: #721c24; }
.badge-pendidikan { background-color: #d4edda; color: #155724; }
.badge-kesehatan { background-color: #e2d9f3; color: #4a1a7a; }
.badge-hiburan { background-color: #ffe8cc; color: #8a4b00; }
.badge-komunikasi { background-color: #cce5ff; color: #004085; }
.badge-lainnya { background-color: #e9ecef; color: #495057; }

/* Category Progress */
.category-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.category-item:last-child {
    border-bottom: none;
}

.category-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Status Badges */
.status-ok { background-color: #d4edda; color: #155724; }
.status-warning { background-color: #fff3cd; color: #856404; }
.status-danger { background-color: #f8d7da; color: #721c24; }

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.15);
}

.form-control,
.form-select {
    border-radius: 8px;
    padding: 10px 14px;
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #495057;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* Alert */
.alert {
    border-radius: 12px;
    border: none;
}

/* Action Buttons in Table */
.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.85rem;
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
}

/* Budget Info Card */
.budget-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.budget-info-row:last-child {
    border-bottom: none;
}

.budget-info-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.budget-info-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Page Transition */
.page-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .summary-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .card-summary h4 {
        font-size: 1.1rem;
    }

    .table th,
    .table td {
        font-size: 0.8rem;
        padding: 8px 6px;
    }
}

/* Empty State */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #adb5bd;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* Expense Amount Highlight */
.amount-highlight {
    font-weight: 600;
    color: var(--danger);
}

/* Date Filter Active */
.filter-active {
    background-color: var(--primary) !important;
    color: white !important;
}

/* Daily Row Expand */
.daily-detail-row {
    background-color: #f8f9fa;
}

.daily-detail-row td {
    padding: 10px 15px;
}

/* Input Group */
.input-group-text {
    border-radius: 8px 0 0 8px;
    background-color: #f8f9fa;
    font-weight: 500;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* Toast Centered */
#toast-wrapper {
    z-index: 1090;
    pointer-events: none;
}

#toast-wrapper .toast {
    min-width: 320px;
    pointer-events: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: none;
    animation: toastZoomIn 0.3s ease;
}

@keyframes toastZoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

#toast-wrapper .toast-body {
    font-size: 0.95rem;
    padding: 12px 16px;
}

#toast-wrapper .toast-header {
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #f0f0f0;
}

/* =============================================
   Auth Page Styles
   ============================================= */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 35px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: authSlideIn 0.4s ease;
}

@keyframes authSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
}

.auth-header h3 {
    color: var(--primary-dark);
}

.auth-form .input-group-text {
    border-radius: 8px 0 0 8px;
    background-color: #f8f9fa;
}

.auth-form .form-control {
    border-radius: 0 8px 8px 0;
}

.auth-form .btn-primary {
    border-radius: 8px;
    padding: 10px;
}

#auth-alert {
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

/* User info in navbar */
#nav-user-info .nav-link {
    cursor: default;
    font-size: 0.9rem;
    opacity: 0.9;
}
