/* PEÑA — Styles */
:root { --pena-green: #00a86b; --pena-dark: #007a4f; }

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

.transition-smooth { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }

/* Animations */
@keyframes p2p-pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.6; transform:scale(1.1); } }
.p2p-pulse { animation: p2p-pulse 2s ease-in-out infinite; }

@keyframes slide-in { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.slide-in { animation: slide-in 0.3s ease-out; }

@keyframes slide-in-right { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
.slide-in-right { animation: slide-in-right 0.3s ease-out; }

@keyframes fade-in { from { opacity:0; } to { opacity:1; } }
.fade-in { animation: fade-in 0.2s ease-out; }

@keyframes scale-in { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.scale-in { animation: scale-in 0.2s ease-out; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.shimmer { background: linear-gradient(90deg, transparent, rgba(0,168,107,0.1), transparent); background-size: 200% 100%; animation: shimmer 1.5s infinite; }

@keyframes bounce-in { 0% { opacity:0; transform:scale(0.3); } 50% { transform:scale(1.05); } 70% { transform:scale(0.9); } 100% { opacity:1; transform:scale(1); } }
.bounce-in { animation: bounce-in 0.5s ease-out; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* Receipt drop */
.receipt-drop { border: 2px dashed rgba(0,168,107,0.3); transition: all 0.2s; }
.receipt-drop:hover { border-color: rgba(0,168,107,0.6); background: rgba(0,168,107,0.03); }

/* Tab active */
.tab-active { border-bottom: 2px solid var(--pena-green); color: var(--pena-green); }

/* Cursor: pointer on interactive elements */
button, [role="button"], .tab-btn, .bottom-nav-item, a, select, input[type="file"], .receipt-drop { cursor: pointer; }

/* Badges */
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-executed { background: #dbeafe; color: #1e40af; }
.dark .badge-pending { background: #78350f; color: #fde68a; }
.dark .badge-approved { background: #064e3b; color: #6ee7b7; }
.dark .badge-executed { background: #1e3a5f; color: #93c5fd; }

/* Progress bar */
.progress-bar { height: 4px; border-radius: 2px; background: rgba(0,168,107,0.15); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--pena-green); transition: width 0.3s ease; }

/* Bottom nav */
.bottom-nav { display: none; }
@media (max-width: 640px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-nav-item {
    flex: 1 0 auto;
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    font-size: 10px;
    color: #6b7280;
    transition: color 0.2s;
    cursor: pointer;
    white-space: nowrap;
  }
  .bottom-nav-item.active { color: var(--pena-green); }
  .bottom-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
  body { padding-bottom: 64px; }
  .desktop-tabs { display: none !important; }
}

/* Desktop tabs */
@media (min-width: 641px) {
  .bottom-nav { display: none !important; }
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fade-in 0.2s;
}
.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  animation: scale-in 0.2s;
}
.dark .modal-content { background: #111827; }

/* Toast */
.toast-item {
  pointer-events: auto;
  animation: slide-in-right 0.3s ease-out;
  max-width: 320px;
}

/* Table */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background: rgba(0,168,107,0.05); }
.sort-arrow { display: inline-block; margin-left: 4px; opacity: 0.4; font-size: 10px; }
.sort-arrow.active { opacity: 1; color: var(--pena-green); }

/* Tour highlight — element appears above dark overlay */
.tour-highlight {
  position: relative !important;
  z-index: 9998 !important;
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.8);
  background: white;
  transition: box-shadow 0.3s ease;
}
.dark .tour-highlight {
  background: #111827;
}

/* Tour tooltip (appended to body, above tour-highlight 9998) */
#tour-tooltip {
  z-index: 9999 !important;
}

/* QR code */
.qr-container { display: flex; align-items: center; justify-content: center; padding: 1rem; }

/* No overflow */
#app { overflow-x: hidden; word-wrap: break-word; overflow-wrap: break-word; }

/* Icon sizing */
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }

/* Dark-mode date/select input icons */
.dark input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}
.dark select {
  color-scheme: dark;
}
