/* ===== Slide Panel (Top-Up / Withdrawal journals) ===== */
.slide-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.3s, opacity 0.3s ease;
}
.slide-overlay.open {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0.3s ease;
}
.slide-overlay .slide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.slide-overlay .slide-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 960px;
  background: hsl(var(--background));
  border-left: 1px solid hsl(var(--border));
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.slide-overlay.open .slide-panel {
  transform: translateX(0);
}

/* ===== Modal ===== */
.funds-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.2s, opacity 0.2s ease;
}
.funds-modal.open {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0.2s ease;
}
.funds-modal .modal-box {
  position: relative;
  width: calc(100% - 2rem);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
@media (max-width: 639px) {
  .funds-modal .modal-box {
    width: calc(100% - 1rem);
    max-height: calc(100vh - 1rem);
    border-radius: 0.75rem;
  }
}
.funds-modal.open .modal-box {
  transform: translateY(0) scale(1);
}

/* ===== Form control ===== */
.fm-form-control {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--card-foreground));
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fm-form-control:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}
.fm-form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.fm-form-control option {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
}

/* ===== Status badges ===== */
.badge-in-progress {
  background: hsl(45 93% 47% / 0.15);
  color: hsl(45 80% 40%);
}
.badge-completed {
  background: hsl(142 71% 45% / 0.15);
  color: hsl(142 60% 35%);
}
.badge-cancelled {
  background: hsl(0 84% 60% / 0.15);
  color: hsl(0 72% 50%);
}
.dark .badge-in-progress { color: hsl(45 93% 60%); }
.dark .badge-completed { color: hsl(142 71% 55%); }
.dark .badge-cancelled { color: hsl(0 84% 65%); }

/* ===== Journal table ===== */
.j-table {
  width: 100%;
  font-size: 0.8125rem;
}
.j-table thead th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
  white-space: nowrap;
}
.j-table tbody td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--card-foreground));
}
.j-table tbody tr {
  transition: background 0.1s ease;
  cursor: pointer;
}
.j-table tbody tr:hover {
  background: hsl(var(--muted) / 0.3);
}
.j-table th.text-right, .j-table td.text-right { text-align: right; }

@media (max-width: 639px) {
  .j-table {
    font-size: 0.75rem;
  }
  .j-table thead th {
    padding: 0.5rem;
    font-size: 0.6875rem;
  }
  .j-table tbody td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}

/* ===== Invoice frame (always white bg) ===== */
.invoice-frame {
  background: #fff;
  color: #1a1a1a;
  padding: 2rem;
  border-radius: 0.5rem;
  font-size: 13px;
  line-height: 1.6;
}
@media (max-width: 639px) {
  .invoice-frame {
    padding: 1rem;
    font-size: 11px;
  }
}
.invoice-frame table {
  width: 100%;
  border-collapse: collapse;
}
.invoice-frame th, .invoice-frame td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  font-size: 13px;
}
.invoice-frame th {
  background: #f0f0f0;
  font-weight: 600;
  text-align: center;
}

/* ===== Responsive invoice table ===== */
.invoice-table .desktop-only {
  display: table-row-group;
}
.invoice-table .mobile-only {
  display: none;
}

@media (max-width: 767px) {
  .invoice-table .desktop-only {
    display: none;
  }
  .invoice-table .mobile-only {
    display: table-row-group;
  }
  .invoice-table .mobile-label {
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    width: 40%;
    padding: 4px 8px;
    border: 1px solid #ccc;
    background: #f9f9f9;
  }
  .invoice-table .mobile-value {
    width: 60%;
    padding: 4px 8px;
    border: 1px solid #ccc;
    font-size: 0.8125rem;
  }
  .invoice-table .mobile-only td {
    border: 1px solid #ccc;
    padding: 4px 8px;
  }
}
