/* ==========================================================================
   BUYNTAKE CUSTOMER PORTAL — WITHDRAWAL & CASHOUT LEDGER STYLES (withdraw.css)
   A dedicated, high-performance, clean, and responsive design system for cashouts
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SMART CONTROL CENTER & FILTERING PANEL
   -------------------------------------------------------------------------- */
.wth-controls-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wth-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.wth-search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.wth-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.wth-search-input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.wth-search-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.wth-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-subtle);
  border: none;
  color: var(--text-tertiary);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  font-size: 0.9rem;
  line-height: 1;
  text-align: center;
}

.wth-view-toggle-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.wth-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 800;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.wth-view-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Category Filter Tabs */
.wth-tabs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.wth-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.wth-tab-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.wth-tab-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.wth-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
}

.wth-tab-pill.active .wth-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* Secondary Filter Toolbar */
.wth-secondary-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.wth-filter-selects-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wth-filter-select {
  padding: 7px 12px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.wth-filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.wth-results-meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

/* Action Buttons */
.wth-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
}

.wth-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wth-action-btn.primary {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.wth-action-btn.primary:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

/* --------------------------------------------------------------------------
   2. CARD VIEW LAYOUT & ACCORDION DRAWERS
   -------------------------------------------------------------------------- */
.wth-cards-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.wth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.wth-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.wth-card-header {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
  gap: 16px;
}

.wth-card-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 260px;
}

.wth-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.wth-avatar.branch {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(79, 70, 229, 0.05));
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.wth-avatar.company {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.wth-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wth-outlet-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.wth-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wth-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.wth-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--text-tertiary);
}

.wth-card-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.wth-amount-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.wth-amount-val {
  font-size: 1.25rem;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
  color: var(--accent-emerald);
}

.wth-points-val {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.wth-toggle-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: transform 0.25s ease;
}

.wth-card.expanded .wth-toggle-arrow {
  transform: rotate(180deg);
  background: var(--primary-light);
  color: var(--primary);
}

/* Expandable Drawer */
.wth-drawer {
  padding: 20px 22px;
  background: var(--bg-app);
  border-top: 1px solid var(--border-subtle);
  animation: fadeIn 0.25s ease;
}

.wth-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}

.wth-kv-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wth-k-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wth-v-value {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.wth-v-value.mono {
  font-family: var(--font-mono, monospace);
}

.wth-v-value.copyable {
  cursor: pointer;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wth-v-value.copyable:hover {
  text-decoration: underline;
}

.wth-drawer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

/* --------------------------------------------------------------------------
   3. COMPACT LEDGER TABLE VIEW
   -------------------------------------------------------------------------- */
.wth-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.wth-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.wth-table th {
  background: var(--bg-app);
  padding: 14px 18px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
}

.wth-table td {
  padding: 16px 18px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.wth-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.03);
}

/* --------------------------------------------------------------------------
   4. PAGINATION CONTROLS
   -------------------------------------------------------------------------- */
.wth-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
}

.wth-page-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wth-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.wth-page-btn:hover:not(:disabled) {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.wth-page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.wth-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
