/* ==========================================================================
   ADMIN DASHBOARD CSS: SAVANCE DESKTOP + VIKRAM MOBILE + MONEY BAG LOADER
   ========================================================================== */

#app-loader {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 350ms ease, visibility 350ms ease;
}
#app-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-box {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.loader-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 15px;
  color: #111111;
}
.loader-track {
  width: 100%;
  height: 26px;
  background: #FFFFFF;
  border: 3.5px solid #111111;
  border-radius: var(--radius-pill);
  position: relative;
  overflow: visible;
}
.loader-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: #2D2D38;
  border-radius: var(--radius-pill);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 120ms linear;
}
.loader-sack-carrier {
  position: absolute;
  top: -24px;
  left: 0;
  width: 52px;
  height: 60px;
  margin-left: -26px;
  transform: translate3d(0, 0, 0);
  transition: transform 120ms linear;
  pointer-events: none;
}
.loader-sack-svg {
  width: 100%;
  height: 100%;
}

#lock-screen {
  position: fixed;
  inset: 0;
  background: rgba(9, 8, 13, 0.94);
  backdrop-filter: blur(24px);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
#lock-screen.active {
  opacity: 1;
  pointer-events: auto;
}
.lock-card {
  width: 100%;
  max-width: 360px;
  background: #14121E;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.40);
  border-radius: var(--radius-card);
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}
.lock-icon-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.lock-title {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
}
.lock-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.lock-input {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: 15px;
  color: #FFFFFF;
  outline: none;
  margin-bottom: 14px;
  font-family: var(--font-mono);
}
.lock-input:focus {
  border-color: var(--accent-blue);
}
.lock-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  color: #09080D;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 150ms ease;
}
.lock-btn:active {
  transform: scale(0.97);
}
.lock-error {
  color: var(--accent-rose);
  font-size: 12px;
  margin-top: 10px;
}

.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

@media (min-width: 960px) {
  .app-sidebar {
    width: 250px;
    background: rgba(14, 12, 20, 0.85);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
  }
  .app-main {
    flex: 1;
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: calc(100% - 250px);
  }
  .floating-bottom-dock {
    display: none !important;
  }
  .savance-desktop-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 24px;
  }
  .savance-top-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }
}

@media (max-width: 959px) {
  .app-sidebar {
    display: none;
  }
  .app-main {
    width: 100%;
    padding: 16px 16px calc(80px + var(--safe-bottom));
  }
  .savance-desktop-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .savance-top-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.sidebar-logo-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #09080D;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-logo-text {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: left;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}
.sidebar-link.active {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.savance-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.savance-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.savance-card-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.savance-card-val {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
}
.savance-card-sub {
  font-size: 11px;
  color: var(--accent-emerald);
  font-weight: 600;
}

.vikram-card-pocket {
  position: relative;
  background: #110F17;
  border-radius: var(--radius-card);
  padding: 24px 20px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 20px;
  overflow: hidden;
}
.leather-stitch-border {
  position: absolute;
  inset: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
  border-radius: calc(var(--radius-card) - 6px);
  pointer-events: none;
}
.card-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.mc-circles {
  display: flex;
}
.mc-circle-red {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #EB001B;
}
.mc-circle-yellow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #F79E1B;
  margin-left: -8px;
  opacity: 0.9;
}
.card-masked-num {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.08em;
  color: #FFFFFF;
}
.card-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.card-balance-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.card-balance-val {
  font-size: 28px;
  font-weight: 800;
  color: #FFFFFF;
}
.btn-toggle-eye {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.btn-action-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}
.btn-action-tile:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.20);
}
.btn-action-tile svg {
  color: var(--accent-blue);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
}
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tx-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tx-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tx-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}
.tx-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tx-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}
.tx-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.tx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.tx-amount {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}
.tx-tag-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.tx-tag-pill.paid {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
}
.tx-tag-pill.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.kpi-three-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.kpi-mini-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.kpi-mini-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kpi-mini-num {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
}

.installment-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.installment-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms ease;
}
.installment-tab-btn.active {
  background: #FFFFFF;
  color: #09080D;
  border-color: #FFFFFF;
}

.floating-bottom-dock {
  position: fixed;
  bottom: calc(14px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 17, 28, 0.92);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  z-index: 900;
}
.dock-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}
.dock-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.growth-step-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.growth-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.growth-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
}
.growth-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 8, 13, 0.82);
  backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
.ai-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.ai-modal-sheet {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: #14121E;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.40);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-modal-overlay.open .ai-modal-sheet {
  transform: translateY(0);
}
.ai-sheet-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ai-sheet-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.demo-mode-banner {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.btn-demo-auth {
  background: #FFFFFF;
  color: #09080D;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform 150ms ease;
}
.btn-demo-auth:active {
  transform: scale(0.97);
}

.view-switcher-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.view-switcher-bar::-webkit-scrollbar {
  display: none;
}
.view-tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 180ms ease;
}
.view-tab-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #FFFFFF;
}
.view-tab-btn.active {
  background: #FFFFFF;
  color: #09080D;
  border-color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.view-pane {
  display: none;
}
.view-pane.active {
  display: block;
}

.mobile-device-frame {
  max-width: 420px;
  margin: 0 auto;
  background: #110F17;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 36px;
  padding: 20px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}
.device-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.device-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}
.device-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #09080D;
}
.device-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bell-badge-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bell-count-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-rose);
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ===================================================================
   CAPITAL GATEKEEPER & 4-BUCKET P&L EXTENSIONS
   =================================================================== */
.safe-meter-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}
.safe-meter-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 6px 0;
  position: relative;
}
.safe-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10B981, #38BDF8);
  border-radius: 999px;
  transition: width 350ms cubic-bezier(0.16, 1, 0.3, 1), background-color 300ms ease;
}
.safe-meter-fill.warning {
  background: linear-gradient(90deg, #F59E0B, #EF4444);
}
.safe-meter-fill.overspent {
  background: #EF4444;
}

.quick-chip-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}
.chip-btn:hover, .chip-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38BDF8;
  color: #38BDF8;
}

.spend-input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  color: #FFFFFF;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.spend-input-field:focus {
  outline: none;
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.envelope-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 180ms ease, border-color 180ms ease;
}
.envelope-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.ticket-success-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}
