* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  color: #1a202c;
}

body::before {
  content: '';
  position: absolute; width: 100%; height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.floating-shapes { position: fixed; width: 100%; height: 100%; overflow: hidden; z-index: 0; pointer-events: none; }
.shape { position: absolute; background: rgba(255, 255, 255, 0.05); border-radius: 50%; animation: float 20s infinite ease-in-out; }
.shape:nth-child(1){ width: 80px; height: 80px; left: 10%; top: 20%; animation-delay: 0s; }
.shape:nth-child(2){ width: 120px; height: 120px; right: 10%; top: 60%; animation-delay: 2s; }
.shape:nth-child(3){ width: 60px; height: 60px; left: 70%; top: 10%; animation-delay: 4s; }
@keyframes float { 0%,100%{ transform: translateY(0) rotate(0);} 50%{ transform: translateY(-30px) rotate(180deg);} }

.container { max-width: 1200px; margin: 0 auto; padding: 20px; position: relative; z-index: 1; }

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 25px 0; animation: slideDown 0.6s ease;
}

.logo {
  font-size: 32px; font-weight: 800; color: white; display: flex; align-items: center; gap: 12px; letter-spacing: -0.5px; text-decoration: none;
}
.logo-icon {
  width: 48px; height: 48px; background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

nav { display: flex; gap: 40px; }
nav a { color: white; text-decoration: none; font-weight: 600; font-size: 15px; transition: all 0.3s ease; position: relative; }
nav a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: white; transition: width 0.3s ease; }
nav a:hover::after { width: 100%; }
nav a:hover { transform: translateY(-2px); }

.hero { text-align: center; padding: 20px 0 10px; animation: fadeIn 1s ease; }
h1 { font-size: 44px; color: white; margin-bottom: 8px; font-weight: 800; letter-spacing: -0.5px; }
.subtitle { font-size: 18px; color: rgba(255,255,255,0.95); margin-bottom: 25px; font-weight: 400; }

.controls {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 18px; border-radius: 16px; color: white;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
}

.filters { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr) 1.3fr; gap: 10px; width: 100%; }
.filters input, .filters select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 2px solid rgba(226,232,240,0.9);
  background: #f8fafc; color: #1a202c; font-weight: 600; transition: all 0.2s ease;
}
.filters input:focus, .filters select:focus {
  outline: none; border-color: #667eea; background: white; box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.actions { display: flex; gap: 10px; }

.btn {
  padding: 12px 14px; border-radius: 10px; font-weight: 700; border: none; cursor: pointer;
  background: white; color: #4a5568; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.12); }
.btn.primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.btn.danger { background: #fff5f5; color: #c53030; border: 2px solid #fed7d7; }
.btn.export { background: #edf2ff; color: #434190; border: 2px solid #c3dafe; }

.history-card {
  background: white; border-radius: 16px; padding: 0;
  margin-top: 20px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.25);
  overflow: hidden;
}

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px;
  color: #718096; background: #f7fafc; padding: 14px 18px; border-bottom: 1px solid #e2e8f0;
}
tbody td { padding: 14px 18px; border-bottom: 1px solid #edf2f7; font-weight: 600; color: #2d3748; }

.brand {
  display: inline-flex; align-items: center; gap: 8px;
}
.brand img { height: 18px; width: auto; }

.badge {
  display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800;
}
.badge.success { background: #e6fffa; color: #2c7a7b; border: 2px solid #b2f5ea; }

.row-actions { display: flex; gap: 8px; }
.icon-btn {
  background: transparent; border: none; cursor: pointer; font-size: 16px;
}
.icon-btn:hover { transform: translateY(-1px); }

.empty-state {
  text-align: center; padding: 50px 20px;
}
.empty-emoji { font-size: 48px; margin-bottom: 8px; }

footer {
  margin-top: 30px; padding: 40px 0;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.footer-content { text-align: center; color: white; }
.footer-links { display: flex; justify-content: center; gap: 30px; margin-top: 8px; }
.footer-links a { color: rgba(255,255,255,0.9); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: white; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .actions { flex-wrap: wrap; justify-content: flex-end; }
}

/* Modal */
.modal { position: fixed; inset: 0; display: none; }
.modal.show { display: block; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(2px);
}
.modal-content {
  position: relative; max-width: 560px; margin: 80px auto; background: white; border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.35); display: flex; flex-direction: column;
}
.modal-header, .modal-footer { padding: 16px 18px; background: #f7fafc; display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 18px; }

.receipt {
  border: 2px dashed #e2e8f0; border-radius: 12px; padding: 14px; background: #fff;
}
.receipt-row { display: flex; justify-content: space-between; padding: 6px 0; }
.receipt-row strong { color: #4a5568; }

/* Print only the receipt */
@media print {
  body * { visibility: hidden; }
  #receiptBody, #receiptBody * { visibility: visible; }
  #receiptBody { position: absolute; left: 0; top: 0; width: 100%; }
}