/* Base Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --bg-color: #ffffff;
    --text-color: #1e293b;
    --nav-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --nav-bg: #1e293b;
    --card-bg: #1e293b;
    --border-color: #334155;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

[data-theme="dark"] a {
    color: #60a5fa; /* Warna biru yang lebih terang untuk mode gelap */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    width: 100%;
    font-size: 14px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-success {
    background-color: #059669; /* Slightly darker emerald for better contrast */
    color: #ffffff !important;
}

.btn-success:hover {
    background-color: #047857;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.btn-primary {
    background-color: #1d4ed8; /* Slightly darker blue for better contrast in light mode */
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #1e40af;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-warning {
    background-color: #f59e0b;
    color: #ffffff !important;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff !important;
}

.btn-secondary {
    background-color: #64748b;
    color: #ffffff !important;
}

[data-theme="light"] .btn-secondary {
    background-color: #475569; /* Darker slate for better contrast in light mode */
}

[data-theme="dark"] .btn-secondary {
    background-color: #334155;
    color: #ffffff !important;
}

.btn-sm {
    padding: 6px 12px;
    width: auto;
    font-size: 12px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.8;
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-danger { 
    background: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.badge-warning { 
    background: rgba(245, 158, 11, 0.1); 
    color: #d97706; 
    border: 1px solid rgba(245, 158, 11, 0.15);
}
.badge-success { 
    background: rgba(22, 163, 74, 0.1); 
    color: #16a34a; 
    border: 1px solid rgba(22, 163, 74, 0.15);
}

.text-primary { color: var(--primary-color); }
.text-danger { color: #ef4444; }
.text-success { color: #16a34a; }
.font-bold { font-weight: bold; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.flex { display: flex; }
.flex-column { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }

/* Modal / Custom Confirm */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 350px;
    padding: 24px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

.modal-icon {
    width: 50px;
    height: 50px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-color);
}

.modal-text {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn {
    flex: 1;
    margin-top: 0;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideUp 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.toast-success { background: #16a34a; }
.toast-error { background: #ef4444; }

/* Better Card & Layout */
.card {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.card:active {
    transform: scale(0.98);
}

.summary-box {
    padding: 24px;
    border-radius: 24px;
    text-align: center;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.summary-debt {
    background: linear-gradient(135deg, #fecaca, #fee2e2);
    color: #991b1b;
}

[data-theme="dark"] .summary-debt {
    background: linear-gradient(135deg, #7f1d1d, #450a0a);
    color: #fecaca;
}

.summary-asset {
    background: linear-gradient(135deg, #dcfce7, #f0fdf4);
    color: #166534;
}

[data-theme="dark"] .summary-asset {
    background: linear-gradient(135deg, #064e3b, #065f46);
    color: #d1fae5;
}

h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

/* Tracking Timeline */
.tracking-timeline {
    position: relative;
    padding-left: 30px;
    margin: 20px 0;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-dot {
    position: absolute;
    left: -30px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border-color);
    border: 3px solid var(--card-bg);
    z-index: 1;
}

.timeline-item.active .timeline-dot {
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.timeline-item.completed .timeline-dot {
    background: #16a34a;
}

.timeline-content {
    background: var(--nav-bg);
    padding: 12px 16px;
    border-radius: 12px;
}

.timeline-content h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-color);
}

.timeline-content p {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.7;
}

/* Animations */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

#content > * {
    animation: fadeIn 0.3s ease-out;
}
