/* PWA-specific styles */
.app-install-prompt {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007bff;
  color: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
}

.app-install-prompt.show {
  display: block;
}

.app-install-prompt button {
  background: white;
  color: #007bff;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  margin-left: 10px;
  cursor: pointer;
}

.app-install-prompt button:hover {
  background: #f8f9fa;
}

/* Native app feel */
body {
  -webkit-app-region: drag;
  user-select: none;
}

.navbar, .card, .btn, input, select, textarea {
  -webkit-app-region: no-drag;
  user-select: text;
}

/* Smooth transitions */
* {
  transition: all 0.2s ease-in-out;
}

/* Better touch targets for mobile */
.btn, .nav-link {
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Compact buttons inside data tables to prevent tall rows */
.table-modern .btn {
  min-height: 26px !important;
  padding: 0.15rem 0.35rem !important;
  font-size: 0.7rem !important;
  line-height: 1 !important;
}

/* Extra-small button utility (used by actions) */
.btn-xs {
  padding: 0.15rem 0.35rem !important;
  font-size: 0.7rem !important;
  line-height: 1 !important;
}

.table-modern .btn i { font-size: 0.8rem; }
.btn-xs i { font-size: 0.8rem; }

/* Horizontal button group (centralized) */
.btn-group-horizontal {
  display: flex;
  flex-direction: row;
  gap: 0.125rem;
  flex-wrap: wrap;
}

.btn-group-horizontal .btn {
  border-radius: var(--border-radius-sm) !important;
  margin: 0;
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .btn-group-horizontal { flex-direction: column; gap: 0.125rem; }
}

/* Dashboard Styles */
.stats-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 1.5rem;
  color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stats-card.success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.stats-card.info {
  background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

.stats-card.warning {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.stats-card.danger {
  background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.stats-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.stats-card-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0;
}

.stats-card-icon {
  font-size: 2rem;
  opacity: 0.8;
}

 

.quick-action-card {
  display: block;
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: #495057;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  text-align: center;
}

.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  color: #495057;
  text-decoration: none;
}

.quick-action-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  color: white;
  font-size: 1.5rem;
}

.quick-action-text h6 {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #495057;
}

.quick-action-text small {
  color: #6c757d;
} 

/* Global App Theme (unified look matching Expenses page) */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.15);
  --border-radius: 16px;
  --border-radius-sm: 12px;
}

body {
  background: var(--primary-gradient);
  min-height: 100vh;
  padding-top: 64px; /* space for fixed navbar */
}

/* Shared Card Styles */
.content-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  overflow: hidden;
}

.content-card-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  padding: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.content-card-body {
  padding: 1.25rem;
}

/* Plain (white) variant for content cards used on admin/forms pages */
.content-card--plain {
  background: white !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: none !important;
  box-shadow: var(--shadow-light) !important;
}

/* Modern Table */
.table-modern { margin: 0; }

.table-modern thead th {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: none;
  color: #4a5568;
  font-weight: 600;
  padding: 0.375rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Light mode table headers - use theme colors */
[data-theme="light"] .table-modern thead th {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.08) 100%);
  color: #1a202c;
  border-bottom: 2px solid rgba(45, 55, 72, 0.2);
}

.table-modern tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
}

/* Light mode table rows - clearer borders */
[data-theme="light"] .table-modern tbody tr {
  border-bottom: 1px solid rgba(45, 55, 72, 0.12);
  background-color: #ffffff;
}

.table-modern tbody tr:hover { background-color: rgba(0, 0, 0, 0.075) !important; }

/* Light mode table hover */
[data-theme="light"] .table-modern tbody tr:hover { 
  background-color: rgba(102, 126, 234, 0.08) !important; 
}

.table-modern tbody td {
  padding: 0.375rem;
  vertical-align: middle;
  border: none;
  font-size: 0.875rem;
}

/* Light mode table cells - dark text */
[data-theme="light"] .table-modern tbody td {
  color: #2d3748 !important;
}

.table-summary {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  font-weight: 600;
}

/* Sortable Headers */
.sortable-header { cursor: pointer; user-select: none; transition: all 0.2s ease; position: relative; }
.sortable-header:hover { background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%) !important; color: #2d3748; }
.sortable-header i { transition: all 0.2s ease; }
.sortable-header:hover i { color: #667eea !important; }

/* Utility */
.description-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.description-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-badge { padding: 0.2rem 0.4rem; border-radius: 12px; font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* Pagination (centralized) */
.pagination .page-link {
  border-radius: var(--border-radius-sm);
  margin: 0 2px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.pagination .page-item.active .page-link {
  background: var(--primary-gradient);
  border-color: #667eea;
}

/* Modal data boxes (centralized) */
.data-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.2s ease;
  height: 100%;
}

.data-box:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.data-box-highlight {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-color: rgba(102, 126, 234, 0.2);
}

.data-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

/* Light mode data labels - darker for readability */
[data-theme="light"] .data-label {
  color: #4a5568 !important;
}

.data-value {
  font-size: 0.875rem;
  color: #212529;
  font-weight: 500;
  line-height: 1.4;
}

/* Light mode data values - very dark for clarity */
[data-theme="light"] .data-value {
  color: #1a202c !important;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

/* Light mode section titles - darker for clarity */
[data-theme="light"] .section-title {
  color: #2d3748 !important;
  border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.receipt-section,
.actions-section {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.receipt-preview-container {
  background-color: #f8f9fa;
  transition: all 0.3s ease;
  border-radius: 0.375rem;
  overflow: hidden;
  position: relative;
}

.receipt-preview-container:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.receipt-preview-container img { transition: transform 0.3s ease; }
.receipt-preview-container:hover img { transform: scale(1.02); }

.receipt-preview-container .zoom-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.receipt-preview-container:hover .zoom-indicator { opacity: 1; }