/* ==========================================================================
   DANAKU - Kelola Keuangan, Raih Masa Depan
   Pure CSS Stylesheet - Responsive, Accessible, and Clean Design
   ========================================================================== */

:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-dark: #064e3b;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --rose-600: #e11d48;
  --rose-50: #fff1f2;
  --amber-500: #f59e0b;
  --amber-50: #fffbeb;
  --blue-600: #2563eb;
  --blue-50: #eff6ff;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Base Body Styles */
html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: #f8fafc;
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus Rings */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Navigation Tabs */
.nav-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 0.75rem;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.nav-tab-btn.active {
  color: #059669;
  background-color: #ecfdf5;
}

.nav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  background-color: #059669;
  border-radius: 9999px;
}

/* Cards & Elevated Containers */
.card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06);
}

.card-gradient-primary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
}

.card-gradient-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background-color: #ffffff;
  border-radius: var(--radius-2xl);
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-box {
  transform: scale(1);
}

/* Toast Notification */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(1rem);
  opacity: 0;
  animation: toastIn 0.25s forwards, toastOut 0.25s 3.5s forwards;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #f43f5e;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

@keyframes toastIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateY(1rem);
    opacity: 0;
  }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-income {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-expense {
  background-color: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.badge-transfer {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Custom Input Styling */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: #0f172a;
  transition: all 0.15s ease;
}

.form-input:focus {
  background-color: #ffffff;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
  outline: none;
}

/* Print Styles */
@media print {
  nav, header, .no-print, button, .modal-overlay {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .card {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
