
/* UniFlow Finance — visual redesign layer
   Safe override: application logic/assets remain untouched. */

:root {
  --uf-green: #059669;
  --uf-green-2: #10b981;
  --uf-teal: #0f766e;
  --uf-ink: #0f172a;
  --uf-muted: #64748b;
  --uf-surface: rgba(255,255,255,.88);
  --uf-border: rgba(148,163,184,.16);
  --uf-shadow: 0 18px 50px -24px rgba(15,23,42,.28);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}

/* Dashboard shell */
body:has(aside) {
  background:
    radial-gradient(circle at 8% 0%, rgba(16,185,129,.10), transparent 30rem),
    radial-gradient(circle at 95% 10%, rgba(20,184,166,.08), transparent 28rem),
    #f8fafc;
}

body:has(aside.dark),
.dark body:has(aside) {
  background:
    radial-gradient(circle at 10% 0%, rgba(16,185,129,.09), transparent 30rem),
    radial-gradient(circle at 95% 15%, rgba(20,184,166,.07), transparent 28rem),
    #020617;
}

/* Desktop sidebar */
body:has(aside) aside {
  box-shadow: 18px 0 50px -35px rgba(2,44,34,.55);
  backdrop-filter: blur(18px);
}

body:has(aside) aside img {
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.20));
}

body:has(aside) aside nav a {
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

body:has(aside) aside nav a:hover {
  transform: translateX(3px);
}

body:has(aside) aside nav a[aria-current="page"] {
  box-shadow: 0 10px 28px -18px rgba(5,150,105,.55);
}

/* Main content breathing room */
body:has(aside) main,
body:has(aside) [role="main"] {
  scroll-margin-top: 5rem;
}

/* Make cards feel premium without changing their layout */
body:has(aside) .rounded-\[2\.2rem\],
body:has(aside) .rounded-\[2rem\],
body:has(aside) .rounded-\[1\.5rem\],
body:has(aside) .rounded-3xl {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

body:has(aside) .rounded-\[2\.2rem\]:hover,
body:has(aside) .rounded-\[2rem\]:hover {
  box-shadow: 0 24px 60px -32px rgba(15,23,42,.32);
}

/* Dashboard hero/card areas */
body:has(aside) .bg-gradient-to-br.from-\[\#059669\] {
  position: relative;
  overflow: hidden;
  box-shadow:
    0 28px 65px -30px rgba(5,150,105,.55),
    inset 0 1px 0 rgba(255,255,255,.18);
}

body:has(aside) .bg-gradient-to-br.from-\[\#059669\]::after {
  content: "";
  position: absolute;
  width: 20rem;
  height: 20rem;
  right: -8rem;
  top: -9rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 68%);
  pointer-events: none;
}

/* Generic white dashboard cards */
body:has(aside) .bg-white:not(button),
body:has(aside) .dark\:bg-slate-900 {
  --uf-card-border: rgba(148,163,184,.15);
}

@media (min-width: 1024px) {
  body:has(aside) .flex-1.p-4.sm\:p-6.lg\:p-8 {
    padding-top: 1.25rem;
  }
}

/* Headings */
body:has(aside) h1 {
  letter-spacing: -0.04em;
}

body:has(aside) h2,
body:has(aside) h3 {
  letter-spacing: -0.025em;
}

/* Buttons: slightly more tactile */
body:has(aside) button:not([aria-label]),
body:has(aside) a[class*="bg-gradient"] {
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

body:has(aside) button:not([disabled]):active {
  transform: translateY(1px) scale(.985);
}

body:has(aside) button[class*="bg-gradient"]:hover {
  filter: saturate(1.08);
}

/* Form controls */
body:has(aside) input,
body:has(aside) select,
body:has(aside) textarea {
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

body:has(aside) input:focus,
body:has(aside) select:focus,
body:has(aside) textarea:focus {
  box-shadow: 0 0 0 4px rgba(16,185,129,.10);
}

/* Mobile navigation */
@media (max-width: 1023px) {
  body:has(aside) {
    padding-bottom: 5.5rem;
  }

  body:has(aside) .fixed.bottom-6.left-4.right-4 {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  body:has(aside) .fixed.bottom-6.left-4.right-4 nav {
    height: 68px;
    padding-left: 12px;
    padding-right: 12px;
    background: rgba(5,150,105,.94);
    border: 1px solid rgba(255,255,255,.20);
    box-shadow:
      0 24px 60px -22px rgba(2,44,34,.55),
      inset 0 1px 0 rgba(255,255,255,.15);
    backdrop-filter: blur(22px) saturate(150%);
  }

  body:has(aside) .fixed.bottom-6.left-4.right-4 nav > a {
    width: 3.5rem;
  }
}

/* Floating add button */
body:has(aside) .fixed.hidden.lg\:flex.bottom-8.right-8 {
  width: 60px;
  height: 60px;
  box-shadow:
    0 18px 40px -14px rgba(5,150,105,.70),
    0 0 0 6px rgba(16,185,129,.08);
}

body:has(aside) .fixed.hidden.lg\:flex.bottom-8.right-8:hover {
  transform: translateY(-3px) scale(1.04);
}

/* FIA assistant */
body:has(aside) .fixed.bottom-24.right-4.lg\:bottom-8.lg\:right-28 {
  box-shadow:
    0 24px 55px -18px rgba(124,58,237,.60),
    0 0 0 6px rgba(168,85,247,.07);
}

/* Tables/lists */
body:has(aside) table {
  border-collapse: separate;
  border-spacing: 0;
}

body:has(aside) tbody tr {
  transition: background .18s ease;
}

body:has(aside) tbody tr:hover {
  background: rgba(16,185,129,.035);
}

/* Scrollbar */
body:has(aside) ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body:has(aside) ::-webkit-scrollbar-track {
  background: transparent;
}

body:has(aside) ::-webkit-scrollbar-thumb {
  background: rgba(100,116,139,.28);
  border-radius: 999px;
}

body:has(aside) ::-webkit-scrollbar-thumb:hover {
  background: rgba(5,150,105,.48);
}

/* Dark mode */
.dark body:has(aside) {
  color-scheme: dark;
}

.dark body:has(aside) .bg-white {
  box-shadow: 0 18px 55px -34px rgba(0,0,0,.85);
}

.dark body:has(aside) .border-slate-100 {
  border-color: rgba(51,65,85,.55);
}

.dark body:has(aside) .fixed.bottom-6.left-4.right-4 nav {
  box-shadow:
    0 24px 65px -20px rgba(0,0,0,.80),
    inset 0 1px 0 rgba(255,255,255,.08);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body:has(aside) *,
  body:has(aside) *::before,
  body:has(aside) *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
