/**
 * TheNeeds Store — Unified Refero Shop Design System
 * Global Theme Override for Vue Inertia & Blade Templates
 * Colorway: Shop Violet (#5433eb), Canvas Mist (#f2f4f5), Soft Card (#ffffff)
 * Geometry: 28px card, 20px media, 14px inputs, 9999px pills
 * Soft Dual-Layer Elevation & Smooth Micro-Interactions
 */

:root {
  /* Surfaces */
  --c-bg: #f2f4f5 !important;
  --c-surface: #ffffff !important;
  --c-surface-2: #f8fafc !important;
  --c-border: rgba(0, 0, 0, 0.06) !important;
  --c-border-strong: rgba(0, 0, 0, 0.08) !important;

  /* Text & Inks */
  --c-text: #111827 !important;
  --c-text-2: #4b5563 !important;
  --c-muted: #6b7280 !important;
  --c-subtle: #9ca3af !important;
  --c-ink: #111827 !important;

  /* Primary Accent: Shop Violet */
  --c-primary: #5433eb !important;
  --c-primary-hover: #4527d1 !important;
  --c-primary-soft: rgba(84, 51, 235, 0.08) !important;
  --c-accent: #5433eb !important;
  --c-accent-strong: #5433eb !important;

  /* Callout & Neutral Tints (eliminating yellow brutalist banners) */
  --c-callout: #f2f4f5 !important;
  --c-callout-fg: #111827 !important;
  --c-card-saffron: #f8fafc !important;
  --c-card-mint: rgba(16, 185, 129, 0.08) !important;
  --c-card-lavender: rgba(84, 51, 235, 0.06) !important;
  --c-card-pink: rgba(236, 72, 153, 0.06) !important;

  /* Radii Scale */
  --radius-sm: 8px !important;
  --radius-md: 14px !important;
  --radius-lg: 20px !important;
  --radius-xl: 24px !important;
  --radius-2xl: 28px !important;
  --radius-full: 9999px !important;

  /* Soft Dual-Layer Elevation (Zero Brutalist Offset) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.03) !important;
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.03) !important;
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
  --shadow-focus: 0 0 0 3px rgba(84, 51, 235, 0.25) !important;
}

/* Base Body Styling */
body {
  background-color: var(--c-bg) !important;
  color: var(--c-text) !important;
  -webkit-font-smoothing: antialiased;
}

/* Eliminate Harsh 2px Black Borders Everywhere */
.border-ink,
[class*="border-ink"] {
  border-color: rgba(0, 0, 0, 0.07) !important;
}

.border-2 {
  border-width: 1px !important;
}

.border-b-2 {
  border-bottom-width: 1px !important;
}

.border-t-2 {
  border-top-width: 1px !important;
}

.border-r-2 {
  border-right-width: 1px !important;
}

.border-l-2 {
  border-left-width: 1px !important;
}

/* Eliminate Harsh Brutalist Offset Box-Shadows */
.shadow-bf-1,
.shadow-bf-2,
.shadow-bf-3,
.shadow-bf-4 {
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.03) !important;
}

/* Smooth Interactive States (Disable jerky brutalist translation jumps) */
.hover\:-translate-x-px:hover,
.hover\:-translate-y-px:hover,
.hover\:-translate-x-\[1px\]:hover,
.hover\:-translate-y-\[1px\]:hover {
  transform: none !important;
}

.active\:translate-x-\[2px\]:active,
.active\:translate-y-\[2px\]:active,
.active\:translate-x-\[1px\]:active,
.active\:translate-y-\[1px\]:active {
  transform: scale(0.985) !important;
  transition: transform 120ms ease !important;
}

/* --- BUTTON SYSTEM --- */
/* Primary Buttons (Shop Violet Pill) */
button.bg-primary,
a.bg-primary:not(aside nav a) {
  background-color: #5433eb !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(84, 51, 235, 0.3) !important;
  box-shadow: 0 4px 14px 0 rgba(84, 51, 235, 0.35) !important;
  font-weight: 600 !important;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

button.bg-primary:hover,
a.bg-primary:not(aside nav a):hover {
  background-color: #4527d1 !important;
  box-shadow: 0 6px 20px 0 rgba(84, 51, 235, 0.45) !important;
  transform: translateY(-1px) !important;
}

button.bg-primary:active,
a.bg-primary:not(aside nav a):active {
  background-color: #391eb5 !important;
  transform: scale(0.98) !important;
}

/* Secondary Buttons (Soft Neutral Pill) */
button.bg-surface,
a.bg-surface:not(aside nav a) {
  background-color: #ffffff !important;
  color: #111827 !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

button.bg-surface:hover,
a.bg-surface:not(aside nav a):hover {
  background-color: #f8fafc !important;
  border-color: rgba(0, 0, 0, 0.14) !important;
  transform: translateY(-1px) !important;
}

/* Form Inputs (Smooth Curves, Zero Harsh Stamping) */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-radius: 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background-color: #ffffff !important;
  color: #111827 !important;
  transition: border-color 160ms ease, box-shadow 160ms ease !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: #5433eb !important;
  box-shadow: 0 0 0 3px rgba(84, 51, 235, 0.22) !important;
}

/* --- SIDEBAR & NAVIGATION RESKIN --- */
aside {
  background-color: #ffffff !important;
  border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
}

aside > div:first-child {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

aside nav a {
  border-radius: 12px !important;
  font-weight: 500 !important;
  color: #4b5563 !important;
  transition: all 140ms ease !important;
}

aside nav a:hover {
  background-color: #f8fafc !important;
  color: #111827 !important;
}

/* Active Nav Item: Soft Violet Tint (No Brutalist Lime) */
aside nav a.bg-primary {
  background-color: rgba(84, 51, 235, 0.08) !important;
  color: #5433eb !important;
  border: 1px solid rgba(84, 51, 235, 0.18) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

aside nav a.bg-primary svg {
  stroke: #5433eb !important;
}

/* Topbar Header */
header.sticky {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Global Search Bar */
button:has(kbd) {
  border-radius: 9999px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background-color: #f8fafc !important;
}

/* --- CARDS & PANELS --- */
.bg-surface.rounded-lg,
.bg-surface.rounded-md,
.bg-surface.rounded-xl {
  border-radius: 20px !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04) !important;
}

/* Auth Cards (Login / Register / OTP) */
main.bg-callout {
  background-color: #f2f4f5 !important;
}

main.bg-callout header {
  background-color: #ffffff !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

main.bg-callout .rounded-lg {
  border-radius: 28px !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  background-color: #ffffff !important;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.08) !important;
  padding: 32px !important;
}

/* Modals & Dialogs */
[role="dialog"] {
  border-radius: 24px !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.18) !important;
}

/* Badges & Status Pills */
.bg-primary-soft {
  background-color: rgba(84, 51, 235, 0.08) !important;
  color: #5433eb !important;
  border-radius: 9999px !important;
}

.bg-danger-soft {
  background-color: rgba(239, 68, 68, 0.08) !important;
  color: #dc2626 !important;
  border-radius: 9999px !important;
}

.bg-success-soft {
  background-color: rgba(16, 185, 129, 0.08) !important;
  color: #059669 !important;
  border-radius: 9999px !important;
}

.bg-warning-soft {
  background-color: rgba(245, 158, 11, 0.08) !important;
  color: #d97706 !important;
  border-radius: 9999px !important;
}

/* Tables in Admin */
table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

th {
  background-color: #f8fafc !important;
  color: #6b7280 !important;
  font-weight: 600 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
}

/* Pagination Pills */
nav[role="navigation"] button,
nav[role="navigation"] a {
  border-radius: 9999px !important;
}

/* --- Refero Polish & Anti-Collision Overrides (Desainer-All-Role) --- */

/* Fix flex truncate collisions across cards, dashboard, lists */
.truncate {
  min-width: 0 !important;
  flex-shrink: 1 !important;
}

ul li.flex.justify-between,
li.flex.justify-between.items-center {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

ul li.flex.justify-between > span:first-child,
li.flex.justify-between.items-center > span:first-child {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

ul li.flex.justify-between > span:last-child,
li.flex.justify-between.items-center > span:last-child {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  text-align: right !important;
}

/* Fix login card links collision */
main.bg-callout .flex.items-center.justify-between.text-xs {
  flex-direction: column !important;
  gap: 12px !important;
  align-items: center !important;
  margin-top: 16px !important;
}

main.bg-callout .flex.items-center.justify-between.text-xs > div {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

/* Order status pills refinement */
td .flex.flex-col.gap-1.items-start span {
  border-radius: 9999px !important;
  box-shadow: none !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Fix high contrast badge on active filter */
.bg-primary .bg-primary,
button.bg-primary span.bg-primary-soft,
a.bg-primary span {
  background-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* Login Specific Refinements */
main#main-content > header .max-w-6xl {
  justify-content: center !important;
}

main#main-content form div.flex.items-center.justify-between.text-sm.pt-1,
form .flex.items-center.justify-between.text-sm {
  flex-direction: column !important;
  gap: 12px !important;
  align-items: center !important;
  margin-top: 14px !important;
}

main#main-content form div.flex.items-center.justify-between.text-sm.pt-1 > div,
form .flex.items-center.justify-between.text-sm > div {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

div:has(> a[href*="/register"]),
div:has(> a[href*="register"]) {
  display: none !important;
}
