/* Mobile-first styles */
body {
  background: #6b758b; /* dark app-style background */
  font-size: 16px;
}

/* ---- Modern app-like cards & sections ---- */
.card {
  border-radius: 16px;
  margin-bottom: 1rem;
  border: none;
}

.card-header {
  border-bottom: none;
}

.card.shadow-sm {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}

.container-fluid {
  max-width: 1140px;
}

/* Hero gradient used on index */
.bg-gradient-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 50%, #22c55e 100%);
}

.bg-gradient-secondary {
  background: linear-gradient(135deg, #1e293b 0%, #020617 100%);
}

/* Subtle lift on tiles/buttons */
.hover-lift {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.4);
}

/* App-style section headings */
h2, h3, h4, h5, h6 {
  letter-spacing: 0.02em;
}

.app-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.quick-actions-title {
  color: #e5e7eb;
}

/* Index stats cards */
.stat-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
}

.stat-amount {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-meta {
  font-size: 0.8rem;
}

.display-6 {
  font-weight: 700;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .display-6 { 
    font-size: 1.75rem; 
  }
  
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Larger touch targets */
  .btn {
    min-height: 44px;
    font-size: 16px;
    padding: 0.5rem 1rem;
  }
  
  .btn-sm {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    font-size: 14px;
  }
  
  /* Better table handling on mobile - hide tables, show cards */
  .table-responsive {
    overflow-x: visible;
  }
  
  .table {
    display: none;
  }
  
  .mobile-card-view {
    display: block;
  }
  
  /* Card view for tables */
  .mobile-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .mobile-card-header {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
  }
  
  .mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .mobile-card-row:last-child {
    border-bottom: none;
  }
  
  .mobile-card-label {
    font-weight: 600;
    color: #6c757d;
    flex: 1;
  }
  
  .mobile-card-value {
    flex: 2;
    text-align: right;
  }
  
  .mobile-card-actions {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .mobile-card-actions .btn {
    flex: 1;
    min-width: calc(50% - 0.25rem);
  }
  
  /* Form improvements */
  .form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
  }
  
  .form-control, .form-select {
    font-size: 16px;
    min-height: 44px;
  }
  
  /* Better spacing */
  h3, h4, h5 {
    margin-bottom: 1rem;
  }
  
  /* Navigation improvements */
  .navbar-nav {
    padding: 0.5rem 0;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    font-size: 16px;
  }
  
  /* Button groups */
  .btn-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  
  .btn-group-mobile .btn {
    width: 100%;
  }
}

/* Desktop - show tables, hide mobile cards */
@media (min-width: 769px) {
  .mobile-card-view {
    display: none;
  }
  
  .table {
    display: table;
  }
}

/* Receipt Paper-like Styles */
.receipt-paper {
  max-width: 600px;
  margin: 0 auto;
  background: #fefefe;
  background-image: 
    linear-gradient(90deg, rgba(200,200,200,0.03) 1px, transparent 1px),
    linear-gradient(rgba(200,200,200,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 40px 50px;
  box-shadow: 
    0 0 0 1px rgba(0,0,0,0.1),
    0 2px 8px rgba(0,0,0,0.15),
    0 10px 30px rgba(0,0,0,0.1);
  border-radius: 2px;
  font-family: 'Georgia', 'Times New Roman', serif;
  color: #2c3e50;
  position: relative;
  line-height: 1.6;
}

.receipt-paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 60px;
  width: 2px;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 20px,
    rgba(200,0,0,0.1) 20px,
    rgba(200,0,0,0.1) 22px
  );
}

.receipt-paper .receipt-header {
  text-align: center;
  margin-bottom: 35px;
  padding-bottom: 20px;
  border-bottom: 2px solid #34495e;
}

.receipt-paper .receipt-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 8px 0;
  letter-spacing: 1px;
  font-family: 'Georgia', serif;
}

.receipt-paper .receipt-header .receipt-type {
  font-size: 18px;
  color: #7f8c8d;
  font-weight: 400;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.receipt-paper .receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dotted #bdc3c7;
  font-size: 15px;
}

.receipt-paper .receipt-row:last-of-type {
  border-bottom: none;
}

.receipt-paper .receipt-label {
  font-weight: 600;
  color: #34495e;
  flex: 1;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.receipt-paper .receipt-value {
  flex: 2;
  text-align: right;
  color: #2c3e50;
  font-weight: 500;
}

.receipt-paper .receipt-amount {
  font-size: 24px;
  font-weight: 700;
  color: #27ae60;
  background: #ecf0f1;
  padding: 15px 20px;
  border-radius: 4px;
  margin: 20px 0;
  text-align: center;
  border: 2px solid #27ae60;
}

.receipt-paper .receipt-divider {
  border: none;
  border-top: 2px dashed #95a5a6;
  margin: 25px 0;
  height: 0;
}

.receipt-paper .receipt-note {
  background: #f8f9fa;
  padding: 15px;
  border-left: 4px solid #3498db;
  margin: 20px 0;
  font-style: italic;
  color: #555;
  border-radius: 2px;
}

.receipt-paper .receipt-footer {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 2px solid #34495e;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.receipt-paper .receipt-signature {
  flex: 1;
}

.receipt-paper .receipt-signature-line {
  border-top: 1px solid #2c3e50;
  width: 200px;
  margin-top: 50px;
  margin-bottom: 5px;
}

.receipt-paper .receipt-signature-label {
  font-size: 12px;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-paper .receipt-generated {
  text-align: right;
  font-size: 11px;
  color: #95a5a6;
  font-style: italic;
}

.receipt-paper .receipt-thanks {
  text-align: center;
  margin-top: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.receipt-paper .receipt-thanks p {
  margin: 0;
  line-height: 1.8;
}

/* Mobile responsive receipt styles */
@media (max-width: 768px) {
  .receipt-paper {
    padding: 20px 15px;
    margin: 0 10px;
    font-size: 14px;
  }

  .receipt-paper .receipt-header h2 {
    font-size: 22px;
  }

  .receipt-paper .receipt-type {
    font-size: 14px;
  }

  .receipt-paper .receipt-row {
    font-size: 14px;
    padding: 8px 0;
  }

  .receipt-paper .receipt-amount {
    font-size: 18px;
    padding: 12px 15px;
    margin: 15px 0;
  }

  .receipt-paper .receipt-signature-line {
    width: 150px;
  }

  .receipt-paper .receipt-thanks {
    font-size: 14px;
    padding: 15px;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}
