/* ═══════════════════════════════════════════════════════════
   Tadawi Dashboard — Reusable Component Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Stat Card ── */
.dash-stat-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.5rem; border-radius: var(--r-lg);
  background: var(--white); border: 1px solid var(--border-light);
  transition: all 0.25s ease;
}
.dash-stat-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.dash-stat-icon {
  width: 48px; height: 48px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--stat-color, var(--primary)) 12%, transparent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-stat-icon i { font-size: 1.25rem; color: var(--stat-color, var(--primary)); }
.dash-stat-info { display: flex; flex-direction: column; }
.dash-stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.dash-stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.125rem; }
.stat-trend { font-size: 0.75rem; font-weight: 600; margin-top: 0.25rem; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* ── Data Table ── */
.dash-table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border-light); background: var(--white); }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.dash-table thead { background: var(--bg-alt); }
.dash-table th { padding: 0.75rem 1rem; text-align: right; font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.dash-table td { padding: 0.75rem 1rem; border-top: 1px solid var(--border-light); color: var(--text-primary); vertical-align: middle; }
.dash-table tbody tr { transition: background 0.15s; }
.dash-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.table-empty { text-align: center; padding: 2rem !important; color: var(--text-muted); }

/* ── Badge ── */
.dash-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.75rem; border-radius: var(--r-full);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.dash-badge--default { background: var(--bg-alt); color: var(--text-muted); }
.dash-badge--primary { background: var(--primary-50); color: var(--primary-dark); }
.dash-badge--success { background: var(--green-bg); color: #15803d; }
.dash-badge--warning { background: var(--amber-bg); color: #b45309; }
.dash-badge--danger { background: var(--red-bg); color: #dc2626; }
.dash-badge--info { background: var(--primary-50); color: var(--primary-dark); }
.dash-badge--muted { background: var(--bg-alt); color: var(--text-muted); }

/* ── Modal ── */
.dash-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  z-index: var(--z-modal); display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.dash-modal-overlay.active { opacity: 1; pointer-events: all; }
.dash-modal {
  background: var(--white); border-radius: var(--r-xl); width: 100%;
  max-height: 90vh; overflow-y: auto; transform: translateY(16px) scale(0.97);
  transition: transform 0.25s ease;
}
.dash-modal-overlay.active .dash-modal { transform: translateY(0) scale(1); }
.dash-modal--sm { max-width: 400px; }
.dash-modal--md { max-width: 560px; }
.dash-modal--lg { max-width: 800px; }
.dash-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-light); }
.dash-modal-header h3 { font-size: 1.125rem; font-weight: 700; }
.dash-modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.dash-modal-close:hover { background: var(--bg-alt); color: var(--text-primary); }
.dash-modal-body { padding: 1.5rem; }
.dash-modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ── Widget ── */
.dash-widget { background: var(--white); border-radius: var(--r-lg); border: 1px solid var(--border-light); overflow: hidden; }
.dash-widget-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light); }
.dash-widget-header h4 { font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.dash-widget-header h4 i { color: var(--primary); font-size: 0.875rem; }
.dash-widget-header-actions { display: flex; gap: 0.5rem; }
.dash-widget-body { padding: 1.25rem; }

/* ── Empty State ── */
.dash-empty { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.dash-empty i { font-size: 2.5rem; margin-bottom: 1rem; display: block; opacity: 0.4; }
.dash-empty p { margin-bottom: 1rem; }

/* ── Tabs ── */
.dash-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); padding: 0; margin: 0; list-style: none; }
.dash-tab { padding: 0.625rem 1.25rem; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.dash-tab:hover { color: var(--primary); }
.dash-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Pagination ── */
.dash-pagination { display: flex; align-items: center; gap: 0.375rem; justify-content: center; padding: 1rem; }
.dash-pagination .dash-btn.active { background: var(--primary); color: var(--white); }
.dash-pagination-ellipsis { color: var(--text-muted); padding: 0 0.25rem; }

/* ── Timeline ── */
.dash-timeline { position: relative; padding-right: 1.5rem; }
.dash-timeline::before { content: ''; position: absolute; right: 6px; top: 0; bottom: 0; width: 2px; background: var(--border-light); }
.dash-timeline-item { position: relative; padding-bottom: 1.5rem; padding-right: 1.5rem; }
.dash-timeline-dot { position: absolute; right: -1.5rem; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--white); }
.dash-timeline-time { font-size: 0.75rem; color: var(--text-muted); }
.dash-timeline-content p { font-size: 0.875rem; margin-top: 0.25rem; }
.dash-timeline-content small { color: var(--text-muted); font-size: 0.75rem; }

/* ── Toast ── */
.dash-toast {
  position: fixed; top: 80px; right: 1.5rem; z-index: 9999;
  padding: 0.75rem 1.25rem; border-radius: var(--r-md);
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.875rem;
  box-shadow: var(--sh-xl); transform: translateX(120%); transition: transform 0.3s ease;
}
.dash-toast.visible { transform: translateX(0); }
.dash-toast--success { background: var(--green); color: var(--white); }
.dash-toast--error { background: var(--red); color: var(--white); }
.dash-toast--info { background: var(--primary); color: var(--white); }

/* ── Skeleton ── */
.dash-skeleton { padding: 1rem; }
.dash-skeleton-row { display: flex; gap: 1rem; margin-bottom: 0.75rem; }
.dash-skeleton-cell { height: 1rem; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border-light) 50%, var(--bg-alt) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }

/* ── Search ── */
.dash-search { position: relative; max-width: 320px; }
.dash-search i { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.875rem; }
.dash-search input { width: 100%; padding: 0.625rem 1rem 0.625rem 2.5rem; border-radius: var(--r-md); border: 1.5px solid var(--border); font-size: 0.875rem; background: var(--white); transition: border-color 0.2s; }
.dash-search input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-100); }

/* ── Filter ── */
.dash-filter { display: flex; flex-direction: column; gap: 0.25rem; }
.dash-filter label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.dash-filter select { padding: 0.5rem 0.75rem; border-radius: var(--r-sm); border: 1.5px solid var(--border); font-size: 0.875rem; background: var(--white); }

/* ── Buttons ── */
.dash-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 600; border: none; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.dash-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dash-btn--primary { background: var(--primary); color: var(--white); }
.dash-btn--primary:hover { background: var(--primary-dark); }
.dash-btn--ghost { background: transparent; color: var(--text-body); border: 1.5px solid var(--border); }
.dash-btn--ghost:hover { background: var(--bg-alt); }
.dash-btn--danger { background: var(--red); color: var(--white); }
.dash-btn--danger:hover { background: #dc2626; }
.dash-btn--sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.dash-btn--icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--r-sm); }

/* ── Animations ── */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
