/* ══════════════════════════════════════
   DASHBOARD WRAPPER
══════════════════════════════════════ */
.dashboard-wrapper {
  background: linear-gradient(160deg, #f1f5f9 0%, #e8edf5 100%);
  min-height: calc(100vh - 70px);
  padding-bottom: 60px;
}

/* ══════════════════════════════════════
   WELCOME BANNER
══════════════════════════════════════ */
.dash-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px 24px 56px;
  position: relative;
  overflow: hidden;
}

.dash-banner::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.dash-banner::before {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.dash-banner-inner {
  max-width: 1160px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.dash-banner-left h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  color: white;
  margin: 0 0 6px;
}

.dash-banner-left p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}

.dash-banner-actions {
  display: flex;
  gap: 10px;
  /* flex-wrap: wrap; */
}

.dash-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dash-action-btn.primary {
  background: white;
  color: #667eea;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.dash-action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.dash-action-btn.secondary {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: white;
}

.dash-action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.dash-content {
  max-width: 1160px;
  margin: -32px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* ══════════════════════════════════════
   STAT CARDS
══════════════════════════════════════ */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.10);
  border: 1.5px solid #d1d9e6;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(102, 126, 234, 0.15);
}

.stat-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-icon.purple {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
  color: #667eea;
}

.stat-icon.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
  color: #10b981;
}

.stat-icon.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.15));
  color: #3b82f6;
}

.stat-icon.amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
  color: #f59e0b;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 3px;
}

.stat-label {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════
   SECTION HEADER + FILTERS
══════════════════════════════════════ */
.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.dash-section-head h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.dash-section-head h2 i {
  color: #667eea;
}

.dash-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: white;
  border: 1px solid #e8edf5;
  border-radius: 50px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.dash-filter-btn {
  padding: 7px 16px;
  border-radius: 50px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  white-space: nowrap;
}

.dash-filter-btn:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}

.dash-filter-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.dash-filter-select-wrap {
  display: none;
}

#cdWrap-dashFilter {
  display: none;
}

/* ══════════════════════════════════════
   PURCHASES TABLE WRAPPER
══════════════════════════════════════ */
.purchases-grid {
  background: white;
  border-radius: 18px;
  border: 1.5px solid #d1d9e6;
  box-shadow: 0 2px 16px rgba(102, 126, 234, 0.08);
  overflow: hidden;
}

.purchases-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

/* Table head */
.purchases-table thead tr {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.purchases-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.purchases-table thead th:first-child {
  border-radius: 0;
}

/* Table body rows */
.purchases-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.purchases-table tbody tr:last-child {
  border-bottom: none;
}

.purchases-table tbody tr:hover {
  background: #f8faff;
}

.purchases-table tbody td {
  padding: 10px;
  vertical-align: middle;
  color: #475569;
}

/* Resource cell */
.td-resource {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.td-resource-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.td-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.td-icon.pdf {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
}

.td-icon.excel {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

.td-icon.exam {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.td-icon.freelance {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

.td-icon.default {
  background: #f1f5f9;
}

.td-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.88rem;
  line-height: 1.3;
}

/* Type badge */
.td-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  width: fit-content;
}

.td-badge.pdf {
  background: #fee2e2;
  color: #dc2626;
}

.td-badge.excel {
  background: #dcfce7;
  color: #16a34a;
}

.td-badge.exam {
  background: #dbeafe;
  color: #2563eb;
}

.td-badge.freelance {
  background: #ede9fe;
  color: #7c3aed;
}

.td-badge.default {
  background: #f1f5f9;
  color: #64748b;
}

/* Price */
.td-price {
  font-size: 1rem;
  font-weight: 900;
  color: #667eea;
  white-space: nowrap;
}

/* ID cells */
.td-id {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  font-family: monospace;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Date */
.td-date {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
}

/* Status */
.td-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.td-status.completed {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.td-status.pending {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.td-status.failed {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.td-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Actions */
.td-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.pc-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

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

.pc-btn.receipt {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.pc-btn.download {
 color: #8b5cf6;
  border: 1px solid transparent;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #8b5cf6, #7c3aed) border-box;
}

.pc-btn.view {
  color: #8b5cf6;
  border: 1px solid transparent;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #8b5cf6, #7c3aed) border-box;
}

/* Shimmer rows */
.shimmer-row td {
  padding: 14px 16px;
}

.sh-row-cell {
  height: 14px;
  border-radius: 6px;
  background: #e2e8f0;
}

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: white;
  border-radius: 18px;
  border: 1px solid #e8edf5;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.06);
}

.empty-icon {
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.10), rgba(118, 75, 162, 0.10));
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 20px;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
}

.empty-state p {
  font-size: 0.92rem;
  color: #64748b;
  margin: 0 0 24px;
}

.empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  border-radius: 50px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.empty-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(102, 126, 234, 0.35);
}

/* ══════════════════════════════════════
   SHIMMER
══════════════════════════════════════ */
.shimmer-card {
  background: white;
  border-radius: 18px;
  border: 1px solid #e8edf5;
  overflow: hidden;
  padding: 20px;
}

.shimmer-wrap {
  position: relative;
  overflow: hidden;
}

.shimmer-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: shimMove 1.8s infinite;
  z-index: 1;
}

@keyframes shimMove {
  0% {
    left: -150%
  }

  100% {
    left: 150%
  }
}

.sh {
  background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
  background-size: 400px 100%;
  animation: shimMove 1.8s infinite linear;
  border-radius: 6px;
  margin-bottom: 10px;
}

.sh-bar {
  height: 4px;
  width: 100%;
  border-radius: 0;
  margin-bottom: 0;
}

.sh-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  flex-shrink: 0;
}

.sh-title {
  height: 16px;
  width: 60%;
}

.sh-badge {
  height: 12px;
  width: 35%;
  margin-bottom: 16px;
}

.sh-line {
  height: 36px;
  border-radius: 9px;
}

.sh-btn {
  height: 36px;
  border-radius: 10px;
  flex: 1;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* hide Date col on tablet */
  .purchases-table thead th:nth-child(3),
  .purchases-table tbody td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 640px) {
  .dash-banner {
    padding: 28px 16px 48px;
  }

  .dash-content {
    padding: 0 14px;
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px 12px;
    gap: 10px;
  }

  .stat-num {
    font-size: 1.2rem;
  }

  /* Section head: h2 + cd-wrap inline, filter select on new row */
  .dash-section-head {
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }

  .dash-section-head > h2 {
    flex: 1;
    min-width: 0;
    order: 1;
  }

  .dash-section-head > .cd-wrap {
    order: 2;
    flex-shrink: 0;
  }

  .dash-section-head > #cdWrap-dashFilter {
    order: 3;
    flex-basis: 100%;
    display: inline-flex;
  }

  #cdWrap-dashFilter .cd-btn {
    width: 100%;
    box-sizing: border-box;
  }














































  /* No horizontal scroll — card layout */
  .purchases-grid {
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Hide thead entirely */
  .purchases-table thead {
    display: none;
  }

  /* Table becomes block */
  .purchases-table,
  .purchases-table tbody {
    display: block;
    width: 100%;
  }

  /* Each row = a card */
  .purchases-table tbody tr {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    margin-bottom: 5px;
    border-radius: 14px;
    border: 1.5px solid #d1d9e6;
    box-shadow: 0 2px 10px rgba(102,126,234,0.07);
    padding: 12px 14px;
    border-bottom: 1.5px solid #d1d9e6;
  }

  /* Hide price & date cols — show only resource + actions */
  .purchases-table tbody td:nth-child(2),
  .purchases-table tbody td:nth-child(3) {
    display: none;
  }

  /* Resource cell fills remaining space */
  .purchases-table tbody td:nth-child(1) {
    flex: 1;
    min-width: 0;
    padding: 0;
  }

  /* Actions cell shrinks to content */
  .purchases-table tbody td:nth-child(4) {
    padding: 0;
    flex-shrink: 0;
  }

  .td-resource {
    min-width: 0;
  }

  .td-title {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .td-icon {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
    flex-shrink: 0;
  }

  .td-resource-top {
    min-width: 0;
    gap: 3px;
  }

  .purchases-table .pc-btn.download {
    display: none;
  }

  .td-actions {
    gap: 4px;
  }

  .pc-btn.view {
    padding: 8px 14px;
    font-size: 0.78rem;
    color: #8b5cf6;
    border: 1px solid transparent;
    background: linear-gradient(white, white) padding-box,
      linear-gradient(135deg, #8b5cf6, #7c3aed) border-box;
  }
}

/* ══════════════════════════════════════
   STATUS BADGE (used in modal)
══════════════════════════════════════ */
.td-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.td-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.td-status.completed {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.td-status.pending {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.td-status.failed {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

/* ══════════════════════════════════════
   DETAIL MODAL
══════════════════════════════════════ */
.detail-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.detail-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.detail-modal {
  background: white;
  border-radius: 22px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s;
}

.detail-modal-overlay.open .detail-modal {
  transform: translateY(0);
}

.detail-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.9rem;
  transition: background 0.18s, color 0.18s;
  z-index: 1;
}

.detail-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.detail-modal-body {
  padding: 28px 28px 24px;
}

/* Modal header */
.dm-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.dm-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.dm-icon.pdf {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.dm-icon.excel {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

.dm-icon.exam {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.dm-icon.freelance {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

.dm-icon.default {
  background: #f1f5f9;
}

.dm-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.3;
}

.dm-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* Description */
.dm-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
}

/* Info grid */
.dm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.dm-field {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 12px 14px;
}

.dm-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dm-field-label i {
  color: #667eea;
}

.dm-field-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  word-break: break-all;
}

.dm-field-val.price {
  font-size: 1.3rem;
  font-weight: 900;
  color: #667eea;
}

.dm-field-val.mono {
  font-family: monospace;
  font-size: 0.8rem;
}

/* Modal actions */
.dm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.dm-actions .pc-btn {
  padding: 11px 8px;
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .detail-modal-body {
    padding: 22px 18px 20px;
  }

  .dm-grid {
    grid-template-columns: 1fr;
  }

  .dm-actions {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════
   MOBILE SEARCH BAR (inside dash-content)
══════════════════════════════════════ */
.dash-mobile-search {
  display: none;
  align-items: center;
  gap: 10px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(102,126,234,0.08);
}

.dash-mobile-search i {
  color: #94a3b8;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.dash-mobile-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  background: transparent;
  color: #0f172a;
}

.dash-mobile-search input::placeholder { color: #94a3b8; }

@media (max-width: 768px) {
  .dash-mobile-search { display: flex; }
}

/* Desktop search input — light mode explicit reset */
body:not(.dark-mode) .search-box input,
html:not(.dark-mode) .search-box input {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}

body:not(.dark-mode) .search-box input::placeholder,
html:not(.dark-mode) .search-box input::placeholder {
  color: #94a3b8 !important;
}

/* Desktop search input dark mode */
body.dark-mode .search-box input,
html.dark-mode .search-box input {
  background: #161b22 !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}

body.dark-mode .search-box input::placeholder,
html.dark-mode .search-box input::placeholder {
  color: #484f58 !important;
}

body.dark-mode .search-box input:focus,
html.dark-mode .search-box input:focus {
  border-color: #7c6af7 !important;
  box-shadow: 0 0 0 3px rgba(124,106,247,0.15) !important;
}

/* Mobile search — light mode explicit reset */
body:not(.dark-mode) .dash-mobile-search,
html:not(.dark-mode) .dash-mobile-search {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body:not(.dark-mode) .dash-mobile-search input,
html:not(.dark-mode) .dash-mobile-search input {
  color: #0f172a !important;
}

body:not(.dark-mode) .dash-mobile-search i,
html:not(.dark-mode) .dash-mobile-search i {
  color: #94a3b8 !important;
}

/* Mobile search dark mode */
body.dark-mode .dash-mobile-search,
html.dark-mode .dash-mobile-search {
  background: #161b22 !important;
  border-color: #30363d !important;
  box-shadow: none !important;
}

body.dark-mode .dash-mobile-search i,
html.dark-mode .dash-mobile-search i {
  color: #484f58 !important;
}

body.dark-mode .dash-mobile-search input,
html.dark-mode .dash-mobile-search input {
  color: #e6edf3 !important;
}

body.dark-mode .dash-mobile-search input::placeholder,
html.dark-mode .dash-mobile-search input::placeholder {
  color: #484f58 !important;
}


/* Wrapper */
body.dark-mode .dashboard-wrapper,
html.dark-mode .dashboard-wrapper {
  background: #0d1117 !important;
}

/* Stat cards */
body.dark-mode .stat-card,
html.dark-mode .stat-card {
  background: #161b22 !important;
  border-color: rgba(124,106,247,0.25) !important;
  box-shadow: 0 0 0 1px rgba(124,106,247,0.1), 0 4px 20px rgba(0,0,0,0.35) !important;
}

body.dark-mode .stat-num,
html.dark-mode .stat-num {
  color: #e6edf3 !important;
}

body.dark-mode .stat-label,
html.dark-mode .stat-label {
  color: #8b949e !important;
}

body.dark-mode .stat-icon.purple,
html.dark-mode .stat-icon.purple {
  background: rgba(124,106,247,0.15) !important;
  color: #a78bfa !important;
}

body.dark-mode .stat-icon.green,
html.dark-mode .stat-icon.green {
  background: rgba(16,185,129,0.15) !important;
  color: #34d399 !important;
}

body.dark-mode .stat-icon.blue,
html.dark-mode .stat-icon.blue {
  background: rgba(59,130,246,0.15) !important;
  color: #60a5fa !important;
}

body.dark-mode .stat-icon.amber,
html.dark-mode .stat-icon.amber {
  background: rgba(245,158,11,0.15) !important;
  color: #fbbf24 !important;
}

/* Shimmer bars inside stat cards */
body.dark-mode .sh,
html.dark-mode .sh {
  background: linear-gradient(90deg, #1c2333 25%, #252f42 50%, #1c2333 75%) !important;
  background-size: 400px 100% !important;
  animation: shimMove 1.8s infinite linear !important;
  transition: none !important;
}

body.dark-mode .shimmer-wrap::before,
html.dark-mode .shimmer-wrap::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent) !important;
}

/* Section head */
body.dark-mode .dash-section-head h2,
html.dark-mode .dash-section-head h2 {
  color: #e6edf3 !important;
}

/* Filter pills */
body.dark-mode .dash-filters,
html.dark-mode .dash-filters {
  background: #161b22 !important;
  border-color: #30363d !important;
}

body.dark-mode .dash-filter-btn,
html.dark-mode .dash-filter-btn {
  color: #8b949e !important;
}

body.dark-mode .dash-filter-btn:hover,
html.dark-mode .dash-filter-btn:hover {
  background: rgba(124,106,247,0.1) !important;
  color: #a78bfa !important;
}

body.dark-mode .dash-filter-btn.active,
html.dark-mode .dash-filter-btn.active {
  background: linear-gradient(135deg,#7c6af7,#5b4fcf) !important;
  color: #fff !important;
}

/* Mobile filter select */


body.dark-mode .dash-filter-select-wrap .fa-filter,
html.dark-mode .dash-filter-select-wrap .fa-filter {
  color: #a78bfa !important;
}

body.dark-mode .dash-filter-select-wrap .fa-chevron-down,
html.dark-mode .dash-filter-select-wrap .fa-chevron-down {
  color: #484f58 !important;
}

body.dark-mode .dash-filter-select,
html.dark-mode .dash-filter-select {
  color: #e6edf3 !important;
  background: transparent !important;
}

/* Purchases table — dark mode card rows on mobile */
@media (max-width: 640px) {
  body.dark-mode .purchases-table tbody tr,
  html.dark-mode .purchases-table tbody tr {
    background: #161b22 !important;
    border-color: rgba(124,106,247,0.25) !important;
  }
}

/* Purchases table */
body.dark-mode .purchases-grid,
html.dark-mode .purchases-grid {
  background: #161b22 !important;
  border-color: rgba(124,106,247,0.25) !important;
  box-shadow: 0 0 0 1px rgba(124,106,247,0.1), 0 4px 20px rgba(0,0,0,0.35) !important;
}

body.dark-mode .purchases-table tbody tr,
html.dark-mode .purchases-table tbody tr {
  border-bottom-color: #21293d !important;
}

body.dark-mode .purchases-table tbody tr:hover td,
html.dark-mode .purchases-table tbody tr:hover td {
  background: #1c2333 !important;
}

body.dark-mode .purchases-table tbody td,
html.dark-mode .purchases-table tbody td {
  color: #8b949e !important;
  background: #161b22 !important;
}

body.dark-mode .td-title,
html.dark-mode .td-title {
  color: #e6edf3 !important;
}

body.dark-mode .td-price,
html.dark-mode .td-price {
  color: #a78bfa !important;
}

body.dark-mode .td-date,
html.dark-mode .td-date {
  color: #484f58 !important;
}

/* Type icons dark */
body.dark-mode .td-icon.pdf,
html.dark-mode .td-icon.pdf {
  background: rgba(245,158,11,0.12) !important;
}

body.dark-mode .td-icon.excel,
html.dark-mode .td-icon.excel {
  background: rgba(22,163,74,0.12) !important;
}

body.dark-mode .td-icon.exam,
html.dark-mode .td-icon.exam {
  background: rgba(59,130,246,0.12) !important;
}

body.dark-mode .td-icon.freelance,
html.dark-mode .td-icon.freelance {
  background: rgba(124,58,237,0.12) !important;
}

body.dark-mode .td-icon.default,
html.dark-mode .td-icon.default {
  background: #1c2333 !important;
}

/* Type badges dark */
body.dark-mode .td-badge.pdf,
html.dark-mode .td-badge.pdf {
  background: rgba(220,38,38,0.15) !important;
  color: #fca5a5 !important;
}

body.dark-mode .td-badge.excel,
html.dark-mode .td-badge.excel {
  background: rgba(22,163,74,0.15) !important;
  color: #86efac !important;
}

body.dark-mode .td-badge.exam,
html.dark-mode .td-badge.exam {
  background: rgba(37,99,235,0.15) !important;
  color: #93c5fd !important;
}

body.dark-mode .td-badge.freelance,
html.dark-mode .td-badge.freelance {
  background: rgba(124,58,237,0.15) !important;
  color: #c4b5fd !important;
}

body.dark-mode .td-badge.default,
html.dark-mode .td-badge.default {
  background: #1c2333 !important;
  color: #8b949e !important;
}

/* Action buttons dark */
body.dark-mode .pc-btn.download,
body.dark-mode .pc-btn.view,
html.dark-mode .pc-btn.download,
html.dark-mode .pc-btn.view {
  color: #a78bfa !important;
  background: linear-gradient(#161b22,#161b22) padding-box,
    linear-gradient(135deg,#7c6af7,#5b4fcf) border-box !important;
  border: 1px solid transparent !important;
}

/* Shimmer table rows */
body.dark-mode .shimmer-row td,
html.dark-mode .shimmer-row td {
  background: #161b22 !important;
  border-bottom-color: #21293d !important;
}

/* Empty state */
body.dark-mode .empty-state,
html.dark-mode .empty-state {
  background: #161b22 !important;
  border-color: rgba(124,106,247,0.25) !important;
}

body.dark-mode .empty-state h2,
html.dark-mode .empty-state h2 {
  color: #e6edf3 !important;
}

body.dark-mode .empty-state p,
html.dark-mode .empty-state p {
  color: #8b949e !important;
}

body.dark-mode .empty-icon,
html.dark-mode .empty-icon {
  background: rgba(124,106,247,0.12) !important;
}

body.dark-mode .empty-icon img,
html.dark-mode .empty-icon img {
  filter: invert(1) brightness(1.8) !important;
}

/* Detail modal */
body.dark-mode .detail-modal,
html.dark-mode .detail-modal {
  background: #161b22 !important;
}

body.dark-mode .detail-modal-close,
html.dark-mode .detail-modal-close {
  background: #1c2333 !important;
  color: #8b949e !important;
}

body.dark-mode .dm-title,
html.dark-mode .dm-title {
  color: #e6edf3 !important;
}

body.dark-mode .dm-desc,
html.dark-mode .dm-desc {
  background: #1c2333 !important;
  border-color: #30363d !important;
  color: #8b949e !important;
}

body.dark-mode .dm-field,
html.dark-mode .dm-field {
  background: #1c2333 !important;
  border-color: #30363d !important;
}

body.dark-mode .dm-field-label,
html.dark-mode .dm-field-label {
  color: #484f58 !important;
}

body.dark-mode .dm-field-val,
html.dark-mode .dm-field-val {
  color: #e6edf3 !important;
}

body.dark-mode .dm-field-val.price,
html.dark-mode .dm-field-val.price {
  color: #a78bfa !important;
}

body.dark-mode .dm-field-val.mono,
html.dark-mode .dm-field-val.mono {
  color: #8b949e !important;
}
ield-val {
  color: #e6edf3 !important;
}

body.dark-mode .dm-field-val.price,
html.dark-mode .dm-field-val.price {
  color: #a78bfa !important;
}

body.dark-mode .dm-field-val.mono,
html.dark-mode .dm-field-val.mono {
  color: #8b949e !important;
}
