/* ============================================================================
   VX-UI — the Vedic Vaibhav partner-dashboard design system.
   One lightweight, cached layer loaded app-wide (root layout, AFTER styles.css
   so equal-specificity rules here win the cascade over the legacy Bootstrap theme).

   Design language (locked in the Overview redesign):
     warm cream ground · orange primary #f97316 · white cards with warm borders
     rounded 12–18px · circular icon badges · pill chips/tabs · soft warm shadows

   Performance rules baked in:
     • transitions ONLY on transform / opacity / color / background / border / box-shadow
     • no backdrop-filter, no layout-affecting animations, no >300ms durations
     • every entrance animation is opt-in (.vx-rise) and disabled under reduced motion
   ============================================================================ */

:root {
  /* Color tokens */
  --vx-primary: #f97316;
  --vx-primary-dark: #ea580c;
  --vx-primary-soft: #ffedd5;
  --vx-primary-faint: #fff7ed;
  --vx-ground: #fffaf4;          /* page background          */
  --vx-card: #ffffff;            /* card surface             */
  --vx-border: #eee2d8;          /* hairlines inside cards   */
  --vx-border-strong: #efd9c8;   /* card outlines            */
  --vx-text: #1e293b;
  --vx-muted: #64748b;
  --vx-success: #10b981;
  --vx-warning: #f59e0b;
  --vx-danger: #ef4444;
  --vx-info: #3b82f6;

  /* Shape + elevation */
  --vx-radius: 14px;
  --vx-radius-lg: 18px;
  --vx-radius-pill: 999px;
  --vx-shadow-sm: 0 4px 14px -8px rgba(87, 52, 22, 0.14);
  --vx-shadow-md: 0 12px 28px -14px rgba(87, 52, 22, 0.18);

  /* Motion (single rhythm for the whole app) */
  --vx-t-fast: 0.15s ease;
  --vx-t-med: 0.22s ease;
}

/* ---- Page ground + typography polish ---- */
body {
  background: var(--vx-ground);
}

/* Thin warm scrollbars everywhere (cheap, no JS). */
* {
  scrollbar-width: thin;
  scrollbar-color: #e5d5c8 transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #e5d5c8; border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Visible, on-brand keyboard focus. */
.vx-btn:focus-visible,
.vx-chip:focus-visible,
.vx-tab:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--vx-primary);
  outline-offset: 2px;
}

/* ============================== COMPONENTS ============================== */

/* Card — the standard content container. */
.vx-card {
  background: var(--vx-card);
  border: 1px solid var(--vx-border-strong);
  border-radius: var(--vx-radius-lg);
  box-shadow: var(--vx-shadow-sm);
  padding: 1.5rem;
  transition: box-shadow var(--vx-t-med), transform var(--vx-t-fast);
}
.vx-card.is-hoverable:hover {
  box-shadow: var(--vx-shadow-md);
  transform: translateY(-2px);
}

/* Page header block (title + subtitle + optional actions). */
.vx-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.vx-page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--vx-text);
  letter-spacing: -0.01em;
  margin: 0;
}
.vx-page-sub {
  font-size: 0.85rem;
  color: var(--vx-muted);
  margin: 0.2rem 0 0;
}

/* Circular icon badge (platform / stat icons). */
.vx-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: var(--vx-primary-soft);
  color: var(--vx-primary);
}
.vx-icon-circle.is-outline {
  background: #fff;
  border: 1.5px solid var(--vx-primary);
}
.vx-icon-circle.green  { background: #d1fae5; color: #059669; }
.vx-icon-circle.blue   { background: #dbeafe; color: #1d4ed8; }
.vx-icon-circle.violet { background: #ede9fe; color: #7c3aed; }
.vx-icon-circle.pink   { background: #fce7f3; color: #db2777; }
.vx-icon-circle.amber  { background: #fef3c7; color: #b45309; }

/* Buttons. */
.vx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 11px;
  padding: 0.7rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: 44px; /* touch target */
  transition: background var(--vx-t-fast), color var(--vx-t-fast),
              border-color var(--vx-t-fast), box-shadow var(--vx-t-fast),
              transform 0.06s ease;
  -webkit-tap-highlight-color: transparent;
}
.vx-btn:active { transform: scale(0.98); }
.vx-btn-primary {
  background: linear-gradient(180deg, #ff7a15, #f45700);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(244, 87, 0, 0.55);
}
.vx-btn-primary:hover { filter: brightness(1.05); color: #fff; }
.vx-btn-ghost {
  background: #fff;
  color: var(--vx-text);
  border-color: var(--vx-border);
}
.vx-btn-ghost:hover { border-color: var(--vx-primary); color: var(--vx-primary); }
.vx-btn-danger { background: var(--vx-danger); color: #fff; }
.vx-btn-danger:hover { background: #dc2626; color: #fff; }
.vx-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Pill chips + filter tabs. */
.vx-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: var(--vx-radius-pill);
  background: var(--vx-primary-soft);
  color: var(--vx-primary-dark);
  border: 1px solid transparent;
}
.vx-chip.green  { background: #ecfdf5; color: #059669; }
.vx-chip.blue   { background: #eff6ff; color: #1d4ed8; }
.vx-chip.violet { background: #f5f3ff; color: #7c3aed; }
.vx-chip.pink   { background: #fdf2f8; color: #db2777; }
.vx-chip.amber  { background: #fffbeb; color: #b45309; }
.vx-chip.gray   { background: #f1f5f9; color: #475569; }

.vx-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.vx-tab {
  border: 1px solid var(--vx-border);
  background: #fff;
  color: var(--vx-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  min-height: 36px;
  border-radius: var(--vx-radius-pill);
  cursor: pointer;
  transition: background var(--vx-t-fast), color var(--vx-t-fast), border-color var(--vx-t-fast);
}
.vx-tab:hover { border-color: var(--vx-primary); color: var(--vx-primary); }
.vx-tab.active { background: var(--vx-primary); border-color: var(--vx-primary); color: #fff; }

/* Status badges (semantic, color + text — never color alone). */
.vx-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--vx-radius-pill);
}
.vx-badge.success { background: #ecfdf5; color: #047857; }
.vx-badge.pending { background: #fffbeb; color: #b45309; }
.vx-badge.danger  { background: #fef2f2; color: #b91c1c; }
.vx-badge.info    { background: #eff6ff; color: #1d4ed8; }

/* Inputs. */
.vx-input,
.vx-select {
  width: 100%;
  border: 1px solid var(--vx-border);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--vx-text);
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  transition: border-color var(--vx-t-fast), background var(--vx-t-fast), box-shadow var(--vx-t-fast);
}
.vx-input:focus,
.vx-select:focus {
  outline: none;
  border-color: var(--vx-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.vx-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--vx-muted);
  margin-bottom: 0.35rem;
}

/* Tables — always wrapped so the page never scrolls sideways. */
.vx-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--vx-border-strong);
  border-radius: var(--vx-radius);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.vx-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.vx-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vx-muted);
  background: var(--vx-primary-faint);
  padding: 0.75rem 1rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--vx-border);
}
.vx-table td {
  padding: 0.8rem 1rem;
  color: var(--vx-text);
  border-bottom: 1px solid var(--vx-border);
  vertical-align: middle;
}
.vx-table tbody tr:last-child td { border-bottom: none; }
.vx-table tbody tr { transition: background var(--vx-t-fast); }
.vx-table tbody tr:hover { background: #fffdf9; }

/* Stat tile (bordered pill with icon + label + value). */
.vx-stat {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  background: #fff;
  border: 1px solid var(--vx-border-strong);
  border-radius: var(--vx-radius);
  min-width: 0;
  box-shadow: var(--vx-shadow-sm);
}
.vx-stat .l { font-size: 0.72rem; color: var(--vx-muted); font-weight: 500; line-height: 1.25; }
.vx-stat .v { font-size: 1.08rem; color: var(--vx-text); font-weight: 800; line-height: 1.25;
              font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Empty state. */
.vx-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--vx-muted);
}
.vx-empty iconify-icon { font-size: 2.6rem; color: #d6c7b8; display: block; margin: 0 auto 0.6rem; }

/* Skeleton shimmer for loading states (GPU-cheap: background-position only). */
.vx-skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #f5efe8 25%, #fdf8f2 50%, #f5efe8 75%);
  background-size: 200% 100%;
  animation: vxShimmer 1.2s linear infinite;
  color: transparent !important;
  pointer-events: none;
}
@keyframes vxShimmer { to { background-position: -200% 0; } }

/* ============================== MOTION ============================== */

/* Opt-in entrance: subtle rise+fade, compositor-only. Stagger with .vx-d1..4. */
@keyframes vxRise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vx-rise { animation: vxRise 0.28s ease-out both; }
.vx-d1 { animation-delay: 0.04s; }
.vx-d2 { animation-delay: 0.08s; }
.vx-d3 { animation-delay: 0.12s; }
.vx-d4 { animation-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================== RESPONSIVE ============================== */

/* Comfortable content gutters per breakpoint (pages keep their own layout). */
@media (max-width: 768px) {
  .vx-card { padding: 1.1rem; border-radius: var(--vx-radius); }
  .vx-page-title { font-size: 1.25rem; }
  .vx-table th, .vx-table td { padding: 0.65rem 0.75rem; }
}

/* Utility: hide decorative elements on small screens. */
@media (max-width: 480px) {
  .vx-hide-xs { display: none !important; }
}
