/* ============================
   FINTRACK PREMIUM — STYLE.CSS
   Dark Gold × Emerald × Neon
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

/* === VARIABLES === */
:root {
  --bg-primary: #080c14;
  --bg-secondary: #0d1220;
  --bg-card: #111827;
  --bg-card-hover: #161f30;
  --bg-glass: rgba(255,255,255,0.03);
  --bg-glass-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);

  --gold: #f5c842;
  --gold-dim: #c9a227;
  --gold-glow: rgba(245,200,66,0.18);
  --gold-soft: rgba(245,200,66,0.08);

  --green: #10e8a4;
  --green-dim: #0bb880;
  --green-glow: rgba(16,232,164,0.15);
  --green-soft: rgba(16,232,164,0.08);

  --red: #ff4d6d;
  --red-dim: #cc3354;
  --red-glow: rgba(255,77,109,0.15);
  --red-soft: rgba(255,77,109,0.08);

  --blue: #3b9eff;
  --blue-dim: #2277cc;
  --blue-glow: rgba(59,158,255,0.15);

  --purple: #a855f7;
  --purple-glow: rgba(168,85,247,0.15);

  --orange: #ff9500;
  --orange-glow: rgba(255,149,0,0.15);

  --text-primary: #f0f4ff;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);

  --trans: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --trans-slow: all 0.45s cubic-bezier(0.4,0,0.2,1);

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; border: none; outline: none; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); outline: none; border: none; }
.hidden { display: none !important; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === LOADING ANIMATION === */
@keyframes pulse-glow { 0%,100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes countUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orb-move { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(60px,-40px) scale(1.1); } 66% { transform: translate(-40px,30px) scale(0.9); } }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes glow-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }

/* ===========================
   LOGIN SCREEN
   =========================== */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
}
.login-bg {
  position: absolute; inset: 0; overflow: hidden;
}
.login-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.25;
  animation: orb-move 12s ease-in-out infinite;
}
.orb1 { width: 400px; height: 400px; background: var(--gold); top: -100px; left: -100px; animation-delay: 0s; }
.orb2 { width: 350px; height: 350px; background: var(--green); bottom: -80px; right: -80px; animation-delay: -4s; }
.orb3 { width: 300px; height: 300px; background: var(--blue); top: 50%; left: 50%; animation-delay: -8s; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
}
.login-card {
  position: relative; z-index: 1;
  width: min(440px, 92vw);
  background: rgba(13,18,32,0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 60px var(--gold-glow);
  animation: fadeInUp 0.7s cubic-bezier(0.4,0,0.2,1);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  color: var(--bg-primary);
  box-shadow: 0 4px 20px var(--gold-glow);
}
.logo-text { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--text-primary); }
.logo-badge {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-primary); font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px; letter-spacing: 1px;
}
.login-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; }
.login-card .form-group { margin-bottom: 18px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); margin-bottom: 8px; }
.login-input {
  width: 100%; padding: 13px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 15px;
  transition: var(--trans);
}
.login-input:focus { border-color: var(--gold); background: var(--bg-glass-hover); box-shadow: 0 0 0 3px var(--gold-soft); }
.pin-input { letter-spacing: 8px; font-size: 20px; text-align: center; }
.login-avatar-section { display: flex; justify-content: center; margin: 20px 0; }
.avatar-upload-label { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.avatar-preview {
  width: 72px; height: 72px; border-radius: 50%;
  border: 2px dashed var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; overflow: hidden;
  transition: var(--trans);
  background: var(--bg-glass);
}
.avatar-preview:hover { border-color: var(--gold); background: var(--gold-soft); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-hint { font-size: 12px; color: var(--text-secondary); }
.login-btn {
  width: 100%; padding: 14px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 8px;
  transition: var(--trans);
  box-shadow: 0 4px 24px var(--gold-glow);
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px var(--gold-glow); }
.login-btn:active { transform: translateY(0); }

/* ===========================
   APP LAYOUT
   =========================== */
.app { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 200px;
  background: linear-gradient(180deg, var(--gold-soft) 0%, transparent 100%);
  pointer-events: none;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: var(--bg-primary);
  box-shadow: 0 2px 12px var(--gold-glow);
}
.brand-name { font-family: var(--font-display); font-size: 16px; font-weight: 800; display: block; }
.brand-version { font-size: 10px; color: var(--gold); letter-spacing: 0.5px; }
.sidebar-toggle {
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-secondary); width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--trans);
}
.sidebar-toggle:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

.user-profile-mini {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.user-avatar-mini {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-card);
  box-shadow: 0 0 12px var(--gold-glow);
}
.user-avatar-mini img { width: 100%; height: 100%; object-fit: cover; }
.user-name-mini { font-weight: 600; font-size: 14px; display: block; }
.user-status { font-size: 11px; color: var(--green); display: flex; align-items: center; gap: 4px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-muted); padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: var(--trans);
  position: relative; margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--gold-soft);
  color: var(--gold);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-indicator {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; background: var(--gold);
  border-radius: 3px 0 0 3px;
  transition: var(--trans);
}
.nav-item.active .nav-indicator { height: 24px; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.logout-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: transparent; color: var(--red);
  font-size: 14px; transition: var(--trans);
}
.logout-btn:hover { background: var(--red-soft); }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-primary);
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: rgba(8,12,20,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.mobile-menu-btn {
  display: none;
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-secondary); width: 36px; height: 36px;
  border-radius: 8px; align-items: center; justify-content: center;
}
.page-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 16px;
  transition: var(--trans);
}
.search-bar:focus-within { border-color: var(--gold-dim); background: var(--bg-glass-hover); }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }
.search-bar input { background: transparent; color: var(--text-primary); font-size: 13px; width: 180px; }
.search-bar input::placeholder { color: var(--text-muted); }
.clock-widget { font-size: 13px; color: var(--text-secondary); font-weight: 500; white-space: nowrap; }
.notification-bell {
  position: relative; cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-glass); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: var(--trans);
}
.notification-bell:hover { border-color: var(--gold); color: var(--gold); }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
}
.user-avatar-top {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; overflow: hidden; cursor: pointer;
  background: var(--bg-card);
  transition: var(--trans);
  box-shadow: 0 0 8px var(--gold-glow);
}
.user-avatar-top:hover { box-shadow: 0 0 16px var(--gold-glow); transform: scale(1.05); }
.user-avatar-top img { width: 100%; height: 100%; object-fit: cover; }

/* NOTIFICATION PANEL */
.notif-panel {
  position: absolute; top: calc(var(--topbar-h) + 8px); right: 24px;
  width: 320px; background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 200; animation: slide-down 0.2s ease;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.notif-header button { background: transparent; color: var(--red); font-size: 12px; }
.notif-list { max-height: 280px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: flex-start; gap: 10px;
}
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 18px; flex-shrink: 0; }

/* PAGES */
.pages-container { flex: 1; padding: 24px 28px; }
.page { display: none; animation: fadeInUp 0.3s ease; }
.page.active { display: block; }

/* ===========================
   DASHBOARD
   =========================== */
.welcome-banner {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(245,200,66,0.08) 0%, rgba(16,232,164,0.05) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.welcome-text h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.welcome-date { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.welcome-quote { font-size: 13px; color: var(--gold); font-style: italic; opacity: 0.8; }

/* CARDS GRID */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative; overflow: hidden;
  transition: var(--trans);
  animation: fadeInUp 0.4s ease both;
}
.summary-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}
.card-glow {
  position: absolute; inset: 0;
  opacity: 0; transition: var(--trans);
  pointer-events: none; border-radius: var(--radius);
}
.summary-card:hover .card-glow { opacity: 1; }
.card-balance .card-glow { background: radial-gradient(circle at top right, var(--gold-glow), transparent 60%); }
.card-income .card-glow { background: radial-gradient(circle at top right, var(--green-glow), transparent 60%); }
.card-expense .card-glow { background: radial-gradient(circle at top right, var(--red-glow), transparent 60%); }
.card-debt .card-glow { background: radial-gradient(circle at top right, var(--blue-glow), transparent 60%); }
.card-piutang .card-glow { background: radial-gradient(circle at top right, var(--orange-glow), transparent 60%); }
.card-profit .card-glow { background: radial-gradient(circle at top right, var(--purple-glow), transparent 60%); }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); }
.card-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.card-icon-wrap.gold { background: var(--gold-soft); }
.card-icon-wrap.green { background: var(--green-soft); }
.card-icon-wrap.red { background: var(--red-soft); }
.card-icon-wrap.blue { background: rgba(59,158,255,0.1); }
.card-icon-wrap.orange { background: rgba(255,149,0,0.1); }
.card-icon-wrap.purple { background: rgba(168,85,247,0.1); }

.card-value {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  margin-bottom: 6px;
  animation: countUp 0.4s ease;
}
.card-balance .card-value { color: var(--gold); }
.card-income .card-value { color: var(--green); }
.card-expense .card-value { color: var(--red); }
.card-debt .card-value { color: var(--blue); }
.card-piutang .card-value { color: var(--orange); }
.card-profit .card-value { color: var(--purple); }
.card-sub { font-size: 12px; color: var(--text-muted); }

/* GLOWING BALANCE CARD */
.card-balance {
  border-color: rgba(245,200,66,0.2);
  box-shadow: 0 0 30px var(--gold-glow);
}
.card-balance::before {
  content: '';
  position: absolute; top: -1px; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* DASHBOARD BOTTOM */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}
.chart-card, .recent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.month-label { font-size: 12px; color: var(--gold); font-weight: 600; }
.see-all-btn { background: transparent; color: var(--gold); font-size: 12px; font-weight: 600; transition: var(--trans); }
.see-all-btn:hover { color: var(--text-primary); }
.chart-wrapper { position: relative; height: 220px; }
.chart-wrapper.tall { height: 320px; }

.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  background: var(--bg-glass); border: 1px solid var(--border);
  transition: var(--trans);
}
.recent-item:hover { background: var(--bg-glass-hover); }
.recent-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.recent-dot.income { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.recent-dot.expense { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.recent-name { font-size: 13px; font-weight: 500; flex: 1; }
.recent-amount { font-size: 13px; font-weight: 600; }
.recent-amount.income { color: var(--green); }
.recent-amount.expense { color: var(--red); }

/* ===========================
   TABLES (INCOME / EXPENSE)
   =========================== */
.page-top-actions {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.data-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px;
  transition: var(--trans); flex: 1; min-width: 200px;
}
.table-search:focus-within { border-color: var(--gold-dim); }
.table-search input { background: transparent; color: var(--text-primary); font-size: 13px; width: 100%; }
.table-search input::placeholder { color: var(--text-muted); }
.table-search svg { color: var(--text-muted); flex-shrink: 0; }
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  padding: 13px 18px;
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--trans);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-glass); }
.data-table td { padding: 13px 18px; font-size: 13px; color: var(--text-primary); vertical-align: middle; }
.td-amount { font-weight: 600; }
.td-amount.income { color: var(--green); }
.td-amount.expense { color: var(--red); }
.td-category {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
  background: var(--bg-glass-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.action-btns { display: flex; gap: 6px; }
.edit-btn, .del-btn {
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; transition: var(--trans);
}
.edit-btn { background: rgba(59,158,255,0.1); color: var(--blue); border: 1px solid rgba(59,158,255,0.2); }
.edit-btn:hover { background: rgba(59,158,255,0.2); }
.del-btn { background: var(--red-soft); color: var(--red); border: 1px solid rgba(255,77,109,0.2); }
.del-btn:hover { background: rgba(255,77,109,0.2); }
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted); font-size: 14px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ===========================
   HISTORY
   =========================== */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px; align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--trans);
  animation: fadeInUp 0.3s ease;
}
.history-item:hover { border-color: var(--border-light); transform: translateX(4px); }
.history-item.income { border-left: 3px solid var(--green); }
.history-item.expense { border-left: 3px solid var(--red); }
.hist-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.hist-icon.income { background: var(--green-soft); }
.hist-icon.expense { background: var(--red-soft); }
.hist-details {}
.hist-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hist-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.hist-tag {
  padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 600;
}
.hist-tag.income { background: var(--green-soft); color: var(--green); }
.hist-tag.expense { background: var(--red-soft); color: var(--red); }
.hist-right { text-align: right; }
.hist-amount { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.hist-amount.income { color: var(--green); }
.hist-amount.expense { color: var(--red); }
.hist-date { font-size: 11px; color: var(--text-muted); }

/* ===========================
   STATISTICS
   =========================== */
.stats-filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stats-summary-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 24px;
}
.stat-pill {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-pill.green { border-color: rgba(16,232,164,0.2); }
.stat-pill.red { border-color: rgba(255,77,109,0.2); }
.stat-pill.gold { border-color: rgba(245,200,66,0.2); }
.pill-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); font-weight: 600; }
.pill-val { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.stat-pill.green .pill-val { color: var(--green); }
.stat-pill.red .pill-val { color: var(--red); }
.stat-pill.gold .pill-val { color: var(--gold); }
.charts-row { display: grid; gap: 20px; margin-bottom: 20px; }
.charts-row.two-col { grid-template-columns: 1fr 1fr; }
.charts-row.full-w .chart-card { width: 100%; }
.chart-card.full-w { width: 100%; }

/* ===========================
   DEBT / PIUTANG
   =========================== */
.debt-tabs {
  display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap;
}
.debt-tab {
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); transition: var(--trans);
}
.debt-tab:hover { border-color: var(--border-light); color: var(--text-primary); }
.debt-tab.active { background: var(--gold-soft); border-color: var(--gold-dim); color: var(--gold); }
.debt-content { display: none; }
.debt-content.active { display: block; }
.debt-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.debt-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  transition: var(--trans);
}
.debt-card:hover { border-color: var(--border-light); }
.debt-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.debt-person { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.debt-amount-big { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--gold); }
.debt-card-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.debt-meta-item { font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; }
.debt-meta-item strong { color: var(--text-secondary); font-size: 13px; }
.debt-note { font-size: 12px; color: var(--text-muted); font-style: italic; margin-bottom: 12px; }
.debt-card-footer { display: flex; align-items: center; justify-content: space-between; }
.status-badge {
  padding: 4px 12px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}
.status-badge.unpaid { background: var(--red-soft); color: var(--red); border: 1px solid rgba(255,77,109,0.2); }
.status-badge.paid { background: var(--green-soft); color: var(--green); border: 1px solid rgba(16,232,164,0.2); }
.overdue-badge {
  padding: 3px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 700;
  background: rgba(255,149,0,0.1); color: var(--orange);
  border: 1px solid rgba(255,149,0,0.2);
}

/* ===========================
   CALENDAR
   =========================== */
.calendar-nav {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  margin-bottom: 20px;
}
.cal-nav-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 20px; display: flex; align-items: center; justify-content: center;
  transition: var(--trans);
}
.cal-nav-btn:hover { border-color: var(--gold); color: var(--gold); }
.cal-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; margin-bottom: 16px;
}
.cal-day-header {
  text-align: center; padding: 10px 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: 1px;
}
.cal-day {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; padding: 6px 4px;
  cursor: pointer; transition: var(--trans);
  min-height: 52px;
}
.cal-day:hover { border-color: var(--gold); background: var(--gold-soft); }
.cal-day.today { border-color: var(--gold); background: var(--gold-soft); }
.cal-day.today .cal-day-num { color: var(--gold); font-weight: 700; }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-day-num { font-size: 13px; font-weight: 500; }
.cal-dots { display: flex; gap: 2px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.cal-dot-small { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot-small.income { background: var(--green); }
.cal-dot-small.expense { background: var(--red); }
.cal-legend { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cal-dot.green { background: var(--green); }
.cal-dot.red { background: var(--red); }
.cal-day-detail {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; animation: fadeIn 0.2s ease;
}
.cal-day-detail h4 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--gold); }

/* ===========================
   SETTINGS
   =========================== */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.settings-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.settings-card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.avatar-section { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 20px; }
.avatar-large {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid var(--gold); font-size: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary); overflow: hidden;
  box-shadow: 0 0 20px var(--gold-glow);
}
.avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.change-avatar-btn {
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; padding: 8px 16px;
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--trans);
}
.change-avatar-btn:hover { border-color: var(--gold); color: var(--gold); }
.settings-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
.danger-card { border-color: rgba(255,77,109,0.2); }

/* ===========================
   MODALS
   =========================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: min(580px, 100%);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s cubic-bezier(0.4,0,0.2,1);
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg-glass); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: var(--trans);
}
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal-body { padding: 22px 26px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 26px 22px;
  border-top: 1px solid var(--border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); }
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 14px;
  transition: var(--trans);
}
.form-input:focus { border-color: var(--gold); background: var(--bg-glass-hover); box-shadow: 0 0 0 3px var(--gold-soft); }
select.form-input option { background: var(--bg-card); color: var(--text-primary); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ===========================
   BUTTONS
   =========================== */
.primary-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700;
  transition: var(--trans);
  box-shadow: 0 2px 16px var(--gold-glow);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--gold-glow); }
.primary-btn:active { transform: translateY(0); }
.primary-btn.danger {
  background: linear-gradient(135deg, var(--red), var(--red-dim));
  box-shadow: 0 2px 16px var(--red-glow);
}
.primary-btn.danger:hover { box-shadow: 0 6px 24px var(--red-glow); }
.outline-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: var(--trans);
}
.outline-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.danger-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: var(--red-soft);
  border: 1px solid rgba(255,77,109,0.3);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: var(--trans);
}
.danger-btn:hover { background: rgba(255,77,109,0.2); }

.filter-select {
  padding: 9px 14px;
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 13px;
  transition: var(--trans); cursor: pointer;
}
.filter-select:focus { border-color: var(--gold-dim); }
select.filter-select option { background: var(--bg-card); }

.action-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-group { display: flex; gap: 8px; align-items: center; }

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 14px 22px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  z-index: 9999;
  animation: toast-in 0.3s ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--gold); }

/* ===========================
   SEARCH OVERLAY
   =========================== */
.search-overlay {
  position: fixed; top: calc(var(--topbar-h) + 8px); left: 50%; transform: translateX(-50%);
  width: min(560px, 90vw); z-index: 500;
  animation: slide-down 0.2s ease;
}
.search-results {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--trans);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-glass); }
.search-result-icon { font-size: 20px; }
.search-result-info { flex: 1; }
.search-result-name { font-size: 13px; font-weight: 600; }
.search-result-meta { font-size: 11px; color: var(--text-muted); }
.search-result-amount { font-size: 13px; font-weight: 700; }
.search-result-amount.income { color: var(--green); }
.search-result-amount.expense { color: var(--red); }

/* ===========================
   SIDEBAR COLLAPSED
   =========================== */
.sidebar.collapsed {
  transform: translateX(-100%);
}
.main-content.expanded {
  margin-left: 0;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .charts-row.two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex !important; }
  .pages-container { padding: 16px; }
  .topbar { padding: 0 16px; }
  .search-bar { display: none; }
  .clock-widget { display: none; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-summary-row { grid-template-columns: 1fr; }
  .welcome-banner { flex-direction: column; gap: 8px; text-align: center; }
  .welcome-quote { display: none; }
  .history-item { grid-template-columns: 36px 1fr; }
  .hist-right { display: none; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .debt-tabs { flex-direction: column; }
  .modal { border-radius: var(--radius); }
}

/* ===========================
   MOBILE SIDEBAR OVERLAY
   =========================== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 99;
}
.sidebar-overlay.visible { display: block; }

/* ===========================
   MISC UTILS
   =========================== */
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.font-display { font-family: var(--font-display); }

/* Shimmer skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* Stagger animations for cards */
.summary-card:nth-child(1) { animation-delay: 0.05s; }
.summary-card:nth-child(2) { animation-delay: 0.10s; }
.summary-card:nth-child(3) { animation-delay: 0.15s; }
.summary-card:nth-child(4) { animation-delay: 0.20s; }
.summary-card:nth-child(5) { animation-delay: 0.25s; }
.summary-card:nth-child(6) { animation-delay: 0.30s; }

/* Glowing top border for income/expense rows */
.nav-item.active[data-page="income"] { color: var(--green); background: var(--green-soft); }
.nav-item.active[data-page="income"] .nav-indicator { background: var(--green); }
.nav-item.active[data-page="expense"] { color: var(--red); background: var(--red-soft); }
.nav-item.active[data-page="expense"] .nav-indicator { background: var(--red); }
.nav-item.active[data-page="statistics"] { color: var(--blue); background: rgba(59,158,255,0.1); }
.nav-item.active[data-page="statistics"] .nav-indicator { background: var(--blue); }
.nav-item.active[data-page="debt"] { color: var(--purple); background: rgba(168,85,247,0.1); }
.nav-item.active[data-page="debt"] .nav-indicator { background: var(--purple); }
