/* Custom and responsive enhancements for VauKash */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

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

/* Glassmorphism & card polish */
.card-shadow {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
}
.card-hover:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
  transition: all 0.2s ease-in-out;
}

/* Badge styling */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

/* Person badge with subtle glow */
.person-badge {
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

/* Responsive table & mobile view switches */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }
  .mobile-flex {
    display: flex !important;
  }
  /* Padding tweak on mobile */
  .main-content {
    padding-bottom: 5.5rem !important;
  }
}

@media (min-width: 769px) {
  .desktop-only {
    display: block !important;
  }
  .desktop-flex {
    display: flex !important;
  }
  .desktop-table {
    display: table !important;
  }
  .mobile-only {
    display: none !important;
  }
}

/* Amount typography */
.amount-positive {
  color: #16a34a;
  font-weight: 600;
}
.amount-negative {
  color: #dc2626;
  font-weight: 600;
}
.amount-transfer {
  color: #475569;
  font-weight: 500;
}

/* Modal animation */
.modal-overlay {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  transition: opacity 0.2s ease;
}

/* ========================================================================= */
/* Collapsible & Mobile Sidebar Styles */
/* ========================================================================= */
#app-sidebar {
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 769px) {
  #app-sidebar.sidebar-collapsed {
    width: 4.75rem !important; /* ~76px */
  }

  #app-sidebar.sidebar-collapsed .sidebar-text,
  #app-sidebar.sidebar-collapsed .sidebar-accounts,
  #app-sidebar.sidebar-collapsed .sidebar-badge,
  #app-sidebar.sidebar-collapsed #btn-sidebar-dashboard-edit {
    display: none !important;
  }

  #app-sidebar.sidebar-collapsed .sidebar-header {
    justify-content: center !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  #app-sidebar.sidebar-collapsed .nav-item {
    justify-content: center !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  #app-sidebar.sidebar-collapsed .nav-item span {
    display: none !important;
  }
}

/* Mobile drawer overlay backdrop */
#sidebar-backdrop {
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  transition: opacity 0.25s ease-in-out;
}

/* ========================================================================= */
/* Dashboard Widgets Grid & Drag-and-Drop */
/* ========================================================================= */
.dashboard-widget {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-widget.dragging {
  opacity: 0.45;
  transform: scale(0.99);
}

.dashboard-widget.drag-over {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35) !important;
}

/* Responsive Widget Column Spans */
.widget-col-full {
  grid-column: span 12 / span 12 !important;
}
.widget-col-2-3 {
  grid-column: span 12 / span 12 !important;
}
.widget-col-1-2 {
  grid-column: span 12 / span 12 !important;
}
.widget-col-1-3 {
  grid-column: span 12 / span 12 !important;
}

@media (min-width: 1024px) {
  .widget-col-2-3 {
    grid-column: span 8 / span 12 !important;
  }
  .widget-col-1-2 {
    grid-column: span 6 / span 12 !important;
  }
  .widget-col-1-3 {
    grid-column: span 4 / span 12 !important;
  }
}

/* Widget Header Controls & Handles - Hidden by default, visible only in layout edit mode */
.widget-handle,
.widget-controls {
  display: none !important;
}

.widget-edit-mode .dashboard-widget {
  border-color: #a5b4fc !important;
  box-shadow: 0 4px 6px -1px rgb(99 102 241 / 0.15), 0 2px 4px -2px rgb(99 102 241 / 0.1) !important;
}

.widget-edit-mode .widget-handle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  color: #4f46e5 !important;
  background-color: #e0e7ff !important;
  border-radius: 0.375rem;
}

.widget-edit-mode .widget-handle:active {
  cursor: grabbing;
}

.widget-edit-mode .widget-controls {
  display: inline-flex !important;
  align-items: center;
  opacity: 1 !important;
}

/* ========================================================================= */
/* Focused Transaction Row / Card Navigation Styles */
/* ========================================================================= */
#tx-desktop-tbody tr:focus,
#tx-desktop-tbody tr:focus-visible {
  outline: none;
}

#tx-desktop-tbody tr:focus > td,
#tx-desktop-tbody tr:focus-visible > td {
  background-color: #f1f5f9;
}

#tx-desktop-tbody tr:focus > td:first-child,
#tx-desktop-tbody tr:focus-visible > td:first-child {
  box-shadow: inset 3px 0 0 #4f46e5;
}

#tx-mobile-container > div:focus,
#tx-mobile-container > div:focus-visible {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}


