/* =========================================================
   MY MONEY — style.css (PWA, Responsive & Custom Auth Layout)
========================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --white: #ffffff;
  --bg: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #0284c7;
  --danger: #ef4444;
  --warn: #f59e0b;
  --income-color: #15803d;
  --income-bg: #f0fdf4;
  --income-border: #bbf7d0;
  --expense-color: #b91c1c;
  --expense-bg: #fef2f2;
  --expense-border: #fecaca;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.12);
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --bottom-nav-h: 64px;
  --topbar-h: 56px;
  --period-bar-h: 54px;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}

/* KONTAINER BINGKAI SIMULATOR */
#app-simulator {
  width: 100%;
  height: 100%;
  height: 100dvh;
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

#money-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 501;
}

#app-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (min-width: 600px) {
  html, body {
    position: relative;
    overflow: auto;
  }
  body {
    background: #0f172a;
    padding: 20px;
  }
  #app-simulator {
    max-width: 430px;
    height: 880px;
    border-radius: 40px;
    border: 10px solid #1e293b;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  }
}

@media (max-width: 599px) {
  body {
    background: var(--bg);
    padding: 0;
  }
  #app-simulator {
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* LOGO STYLING */
.app-logo-img { object-fit: contain; display: block; }
.splash-logo { width: 72px; height: 72px; border-radius: 18px; background: #ffffff; padding: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.auth-logo { width: 64px; height: 64px; border-radius: 16px; background: #ffffff; padding: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.topbar-brand { display: flex; align-items: center; gap: 8px; }
.topbar-logo-img { width: 30px; height: 30px; border-radius: 8px; background: #ffffff; padding: 2px; border: 1px solid var(--border); }

/* SPLASH SCREEN */
.splash { position: absolute; inset: 0; background: #0f172a; z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; transition: opacity 0.4s ease, visibility 0.4s ease; }
.splash.hide { opacity: 0; visibility: hidden; }
.splash-content { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.splash-logo-box { margin-bottom: 4px; }
.splash-title { font-size: 26px; font-weight: 800; color: #ffffff; }
.splash-sub { font-size: 14px; color: #94a3b8; }
.splash-tagline { font-size: 12px; color: #64748b; }
.splash-bar { width: 120px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; margin-top: 20px; }
.splash-bar-fill { height: 100%; width: 0%; background: var(--primary); animation: splash-progress 1.5s linear forwards; }
@keyframes splash-progress { from { width: 0%; } to { width: 100%; } }

/* AUTH SCREEN DESIGN FIX (TIDAK BERTUMPUK-TUMPUK) */
.auth-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.auth-box {
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  position: relative;
  z-index: 502;
}
.auth-logo-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; text-align: center; }
.auth-logo-box { margin-bottom: 6px; }
.auth-title { font-size: 24px; font-weight: 800; color: var(--text); }
.auth-tagline { font-size: 12px; color: var(--text-muted); }

.auth-panel { display: flex; flex-direction: column; gap: 12px; }
.auth-panel-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 2px; }

.auth-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn-auth-primary {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.btn-auth-primary:active { opacity: 0.9; }

.btn-google {
  width: 100%;
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 11px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  transition: background 0.2s ease;
}
.btn-google:hover { background: #f8fafc; }

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  margin: 2px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.auth-divider span { padding: 0 10px; text-transform: uppercase; }

.auth-footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  text-align: center;
}
.auth-switch { font-size: 12px; color: var(--text-muted); }
.auth-link { color: var(--primary); font-weight: 700; cursor: pointer; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.pw-wrap { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--white); }
.pw-wrap input { border: none !important; outline: none !important; padding: 11px 12px; font-size: 14px; flex: 1; }
.pw-toggle { background: none; border: none; padding: 0 12px; cursor: pointer; color: var(--text-muted); font-size: 15px; user-select: none; }

/* TOPBAR & PERIOD BAR */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: var(--topbar-h); background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; z-index: 100; }
.topbar-logo { font-size: 18px; font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.btn-export-all { display: flex; align-items: center; gap: 6px; background: var(--text); color: var(--white); border: none; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; cursor: pointer; }
.btn-export-all svg { width: 14px; height: 14px; }
.btn-user-menu { background: none; border: none; cursor: pointer; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--white); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.user-dropdown { position: absolute; top: calc(var(--topbar-h) + 6px); right: 12px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); width: 220px; z-index: 150; display: none; }
.user-dropdown.open { display: block; }
.user-dropdown-info { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.user-dropdown-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--text); color: var(--white); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-dropdown-name { font-size: 13px; font-weight: 700; }
.user-dropdown-username { font-size: 11px; color: var(--text-muted); }
.user-dropdown-divider { height: 1px; background: var(--border); }
.user-dropdown-item { width: 100%; padding: 11px 14px; background: none; border: none; cursor: pointer; text-align: left; font-size: 13px; display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.user-dropdown-item.logout-item { color: var(--danger); }

.period-filter-bar { position: absolute; top: var(--topbar-h); left: 0; right: 0; height: var(--period-bar-h); background: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 8px; z-index: 99; }
.period-select { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 3px 6px; font-size: 12px; font-weight: 600; background: var(--bg); outline: none; }
.period-nav-btn { background: none; border: 1.5px solid var(--border); border-radius: 8px; width: 28px; height: 28px; font-size: 16px; color: var(--text-muted); cursor: pointer; }
.period-today-btn, .period-all-btn { border: 1.5px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 11px; font-weight: 700; cursor: pointer; background: var(--bg); }
.period-all-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* MAIN CONTAINER */
main { 
  flex: 1;
  overflow-y: auto; 
  padding: calc(var(--topbar-h) + var(--period-bar-h) + 16px) 16px calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 24px); 
  -webkit-overflow-scrolling: touch;
}
.view { display: none; opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease; }
.view.active { display: block; opacity: 1; transform: translateY(0); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h2 { font-size: 20px; font-weight: 800; }
.category-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 8px; }

/* CARDS BERANDA */
.exec-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.exec-card { border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.exec-card.income-card { background: var(--income-bg); border: 1px solid var(--income-border); }
.exec-card.expense-card { background: var(--expense-bg); border: 1px solid var(--expense-border); }
.exec-card-label { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.exec-card.income-card .exec-card-label { color: var(--income-color); }
.exec-card.expense-card .exec-card-label { color: var(--expense-color); }
.exec-card-value { font-size: 16px; font-weight: 800; }
.exec-card.income-card .exec-card-value { color: var(--income-color); }
.exec-card.expense-card .exec-card-value { color: var(--expense-color); }
.exec-net { grid-column: 1 / -1; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); }
.exec-net-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.exec-net-value { font-size: 16px; font-weight: 800; }
.exec-net-value.positive { color: var(--income-color); }
.exec-net-value.negative { color: var(--expense-color); }

.summary-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.summary-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s ease; }
.summary-card:active { transform: scale(0.97); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 8px; }
.card-name { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-spent { font-size: 15px; font-weight: 800; display: block; }
.card-total { font-size: 10px; color: var(--text-muted); }
.progress-bar { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--text); transition: width 0.4s ease; }
.progress-fill.warn { background: var(--warn); }
.progress-fill.danger { background: var(--danger); }
.card-remaining { margin-top: 6px; font-size: 10px; color: var(--text-muted); }
.card-remaining.over { color: var(--danger); font-weight: 700; }

.sub-budget-tag { display: inline-block; font-size: 9px; background: #e0f2fe; color: #0284c7; padding: 1px 5px; border-radius: 4px; font-weight: 700; margin-top: 2px; }
.status-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; margin-top: 4px; }
.status-badge.paid { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.status-badge.unpaid { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* LISTS & ITEMS */
.expense-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.expense-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.expense-item.income-item { border-color: var(--income-border); background: var(--income-bg); }
.expense-icon { font-size: 16px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 8px; flex-shrink: 0; }
.expense-info { flex: 1; min-width: 0; }
.expense-desc { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expense-meta { font-size: 11px; color: var(--text-muted); }
.expense-amount { font-weight: 800; font-size: 13px; text-align: right; }
.expense-item.income-item .expense-amount { color: var(--income-color); }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 13px; padding: 2px 4px; color: var(--text-muted); }
.empty-state { color: var(--text-muted); text-align: center; padding: 24px; font-size: 13px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); list-style: none; }

.budget-grid { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.filter-bar select { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; background: var(--white); width: 100%; outline: none; margin-bottom: 12px; }
.saving-total-card { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow); }
.saving-total-icon { font-size: 28px; }
.saving-total-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #1d4ed8; }
.saving-total-value { font-size: 24px; font-weight: 800; color: #1d4ed8; }
.expense-item.saving-item { border-color: #bfdbfe; background: #eff6ff; }

/* BOTTOM NAV */
.bottom-nav { 
  position: absolute; 
  bottom: 0; 
  left: 0; 
  right: 0; 
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); 
  padding-bottom: env(safe-area-inset-bottom, 0px); 
  background: var(--white); 
  border-top: 1px solid var(--border); 
  display: flex; 
  align-items: center; 
  z-index: 100; 
  flex-shrink: 0;
}
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: none; cursor: pointer; color: var(--text-muted); height: var(--bottom-nav-h); }
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn span { font-size: 10px; font-weight: 600; }
.nav-btn.active { color: var(--primary); }
.nav-btn.active svg { stroke: var(--primary); }

.btn-primary { background: var(--text); color: var(--white); border: none; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-secondary { background: var(--white); color: var(--text); border: 1.5px solid var(--border); padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-danger { background: var(--danger); color: var(--white); border: none; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; }

/* TOUR DOTS INDICATOR */
.tour-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,0.15); transition: all 0.2s ease; }
.tour-dot.active { background: var(--primary); width: 18px; border-radius: 99px; }

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

/* MODALS */
.modal-overlay { 
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.4); 
  backdrop-filter: blur(4px); z-index: 200; display: none; 
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal { 
  background: var(--white); border-radius: var(--radius); 
  width: 100%; max-width: 500px; max-height: 85vh; 
  display: flex; flex-direction: column; 
  animation: modal-fade-zoom 0.25s cubic-bezier(0.16, 1, 0.3, 1); 
  box-shadow: var(--shadow-md);
}
.modal.modal-sm { max-width: 340px; margin: auto; max-height: 90vh; }
@keyframes modal-fade-zoom { 
  from { opacity: 0; transform: scale(0.95) translateY(10px); } 
  to { opacity: 1; transform: scale(1) translateY(0); } 
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; font-weight: 800; }
.close-btn { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 4px; border-radius: 4px; transition: background 0.2s; }
.close-btn:hover { background: var(--bg); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

.income-notice-badge {
  font-size: 11px;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  transition: all 0.2s ease;
}
.income-notice-badge.warn {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

#modal-tour, #modal-tour-finish {
  background: rgba(15, 23, 42, 0.12) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.tour-card-glass {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12) !important;
  text-align: left !important;
}
.tour-step-desc { font-size: 13px; color: #1e293b; line-height: 1.6; min-height: 110px; }
.tour-step-desc ul { padding-left: 20px; margin-top: 8px; }
.tour-step-desc li { margin-bottom: 6px; }
.tour-step-desc b { font-weight: 700; color: var(--primary); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.form-group input, .form-group select { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; outline: none; width: 100%; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.amount-wrap { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--white); transition: border-color 0.2s; }
.amount-wrap:focus-within { border-color: var(--primary); }
.amount-prefix { padding: 0 8px 0 14px; font-size: 14px; font-weight: 800; color: var(--text-muted); }
.amount-wrap input { border: none !important; outline: none !important; padding: 12px 14px 12px 0; font-size: 15px; font-weight: 800; flex: 1; }

.icon-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.icon-picker span {
  font-size: 22px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: all 0.2s ease; user-select: none; background: var(--white);
}
.icon-picker span:hover { background: var(--bg); }
.icon-picker span.selected {
  border-color: var(--primary) !important; background: #e0f2fe !important;
  transform: scale(1.05); box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
}

.export-badge { padding: 12px; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; display:flex; align-items:center; gap:8px;}
.period-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toast { position: absolute; bottom: calc(var(--bottom-nav-h) + 16px); left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--white); padding: 10px 20px; border-radius: 99px; font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); z-index: 9999; box-shadow: 0 8px 16px rgba(0,0,0,0.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading-overlay-modern { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(6px); z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.spinner-ring { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary-card.completed-card { background: #f0fdf4; border-color: #bbf7d0; }
.progress-fill.completed { background: #166534 !important; }
.card-remaining.saved { color: #15803d; font-weight: 700; }

.card-bottom-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 4px; }
.btn-card-action { border: none; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; cursor: pointer; transition: background 0.2s ease, transform 0.1s ease; }
.btn-card-action:active { transform: scale(0.94); }
.btn-card-action.complete { background: #15803d; color: #ffffff; }
.btn-card-action.complete:hover { background: #166534; }
.btn-card-action.undo { background: #e2e8f0; color: #475569; }
.btn-card-action.undo:hover { background: #cbd5e1; }

.status-payoff-box { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #eff6ff; border: 2px solid #bfdbfe; border-radius: var(--radius-sm); width: 100%; }

/* DOMPET ANIMATION */
.wallet-overlay { position: absolute; inset: 0; background: #0f172a; z-index: 450; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
.wallet-overlay.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.wallet-wrapper { width: 220px; height: 150px; position: relative; cursor: grab; touch-action: none; perspective: 1000px; transition: transform 0.15s ease-out; }
.wallet-wrapper:active { cursor: grabbing; }
.wallet-body { width: 100%; height: 100%; background: linear-gradient(135deg, #7c2d12 0%, #451a03 100%); border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 2px 4px rgba(255,255,255,0.2); border: 2px solid #9a3412; position: absolute; bottom: 0; display: flex; align-items: center; justify-content: center; z-index: 2; }
.wallet-top-flap { position: absolute; top: 0; left: 0; width: 100%; height: 60%; background: linear-gradient(180deg, #9a3412 0%, #7c2d12 100%); border-radius: 20px 20px 10px 10px; transform-origin: top; transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 4; box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
.wallet-wrapper.open .wallet-top-flap { transform: rotateX(-160deg); }
.wallet-clasp { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); font-size: 24px; z-index: 5; }
.wallet-cash { position: absolute; font-size: 48px; top: 15px; opacity: 0; transform: translateY(20px) scale(0.6); transition: all 0.4s ease 0.1s; z-index: 3; }
.wallet-coins { position: absolute; font-size: 32px; top: 25px; left: 30px; opacity: 0; transform: translateY(20px) scale(0.6); transition: all 0.4s ease 0.2s; z-index: 3; }
.wallet-wrapper.open .wallet-cash { opacity: 1; transform: translateY(-45px) scale(1.1); }
.wallet-wrapper.open .wallet-coins { opacity: 1; transform: translateY(-35px) rotate(-15deg) scale(1); }
.wallet-hint { margin-top: 40px; text-align: center; color: #94a3b8; font-size: 13px; font-weight: 600; pointer-events: none; }
.wallet-arrow { display: block; font-size: 20px; color: var(--primary); animation: bounceSwipeHorizontal 1.2s infinite alternate ease-in-out; }

@keyframes bounceSwipeHorizontal { from { transform: translateX(-10px); opacity: 0.4; } to { transform: translateX(10px); opacity: 1; } }
@keyframes bounceSwipe { from { transform: translateY(0); opacity: 0.4; } to { transform: translateY(-12px); opacity: 1; } }