/* ═══════════════════════════════════════════════════════════════════
   ETC EXPENSES — Receipt Upload, Preview & Lightbox Styles
   Mobile-First (Touch Targets >= 48px), Dark/Light Themes, RTL-Ready
   ═══════════════════════════════════════════════════════════════════ */

/* ── Upload Area Container ───────────────────────────────────────── */
.receipt-upload-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ── Interactive Dropzone ────────────────────────────────────────── */
.receipt-dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.receipt-dropzone:hover,
.receipt-dropzone.dragover {
  border-color: var(--accent);
  background: var(--surface-3);
}

.receipt-dropzone.dragover {
  transform: scale(1.01);
  box-shadow: 0 0 20px var(--accent-glow);
}

.receipt-dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.receipt-dropzone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.receipt-dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-2);
}

/* ── Action Buttons (Mobile-first Touch Targets >= 48px) ────────── */
.receipt-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 480px) {
  .receipt-action-buttons {
    grid-template-columns: 1fr;
  }
}

.btn-receipt-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
}

.btn-receipt-action:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--text);
}

.btn-receipt-camera {
  background: var(--accent);
  color: #ffffff !important;
  border-color: var(--accent);
}

.btn-receipt-camera:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ── Instant Client Preview Card ─────────────────────────────────── */
.receipt-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.receipt-preview-card:hover {
  border-color: var(--border-3);
  box-shadow: var(--shadow);
}

.receipt-thumbnail-wrapper {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.receipt-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.receipt-thumbnail-wrapper:hover .receipt-thumbnail-img {
  transform: scale(1.08);
}

.receipt-pdf-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.receipt-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.receipt-filename {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-meta {
  font-size: 0.78rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.receipt-badge-status {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.receipt-badge-ready {
  background: var(--green-bg);
  color: var(--green);
}

.receipt-badge-uploading {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.receipt-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-receipt-icon {
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-receipt-icon:hover {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

/* ── Progress Bar ────────────────────────────────────────────────── */
.receipt-upload-progress {
  width: 100%;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.receipt-upload-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ── Table & Card Receipt Indicators ─────────────────────────────── */
.receipt-table-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(230, 57, 70, 0.25);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.receipt-table-badge:hover {
  background: var(--accent);
  color: #ffffff;
}

.receipt-table-empty {
  color: var(--text-3);
  font-size: 0.82rem;
}

/* ── Modal Lightbox ──────────────────────────────────────────────── */
.receipt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.receipt-modal-backdrop.active {
  display: flex;
}

.receipt-modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

.receipt-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.receipt-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.receipt-modal-close {
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}

.receipt-modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.receipt-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  min-height: 280px;
  max-height: calc(90vh - 140px);
}

.receipt-modal-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-xs);
  object-fit: contain;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.receipt-modal-iframe {
  width: 100%;
  height: 65vh;
  border: none;
  border-radius: var(--radius-xs);
  background: #ffffff;
}

.receipt-modal-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── RTL Handling ────────────────────────────────────────────────── */
[dir="rtl"] .receipt-meta {
  direction: rtl;
}

[dir="rtl"] .receipt-table-badge svg {
  margin-left: 5px;
  margin-right: 0;
}
