@import "tailwindcss" source(none);
@import "./sp-layout.css";
@import "tw-animate-css";
@source "../js";
@source "../views";
@source "../blocks";
@source "../form-builder";
@source "../../app";


@custom-variant dark (&:is(.dark *));

@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.129 0.042 264.695);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.129 0.042 264.695);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.129 0.042 264.695);
  --primary: oklch(46.00% 0.144 269.45);
  --primary-foreground: oklch(0.984 0.003 247.858);
  --secondary: oklch(0.968 0.007 247.896);
  --secondary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.968 0.007 247.896);
  --muted-foreground: oklch(0.554 0.046 257.417);
  --accent: oklch(0.968 0.007 247.896);
  --accent-foreground: oklch(0.208 0.042 265.755);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.929 0.013 255.508);
  --input: oklch(0.929 0.013 255.508);
  --ring: oklch(0.704 0.04 256.788);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.984 0.003 247.858);
  --sidebar-foreground: oklch(0.129 0.042 264.695);
  --sidebar-primary: oklch(0.208 0.042 265.755);
  --sidebar-primary-foreground: oklch(0.984 0.003 247.858);
  --sidebar-accent: oklch(0.968 0.007 247.896);
  --sidebar-accent-foreground: oklch(0.208 0.042 265.755);
  --sidebar-border: oklch(0.929 0.013 255.508);
  --sidebar-ring: oklch(0.704 0.04 256.788);
}

.dark {
  --background: oklch(0.129 0.042 264.695);
  --foreground: oklch(0.984 0.003 247.858);
  --card: oklch(0.208 0.042 265.755);
  --card-foreground: oklch(0.984 0.003 247.858);
  --popover: oklch(0.208 0.042 265.755);
  --popover-foreground: oklch(0.984 0.003 247.858);
  --primary: oklch(0.929 0.013 255.508);
  --primary-foreground: oklch(0.208 0.042 265.755);
  --secondary: oklch(0.279 0.041 260.031);
  --secondary-foreground: oklch(0.984 0.003 247.858);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --accent: oklch(0.279 0.041 260.031);
  --accent-foreground: oklch(0.984 0.003 247.858);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.551 0.027 264.364);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.208 0.042 265.755);
  --sidebar-foreground: oklch(0.984 0.003 247.858);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.984 0.003 247.858);
  --sidebar-accent: oklch(0.279 0.041 260.031);
  --sidebar-accent-foreground: oklch(0.984 0.003 247.858);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.551 0.027 264.364);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* ── Integrations page ─────────────────────────────────── */

.sp-integrations-toolbar {
  gap: 0.75rem;
}

.sp-period-selector {
  @apply inline-flex items-center gap-1 rounded-lg border border-border bg-muted/40 p-1;
}

.sp-period-selector__item {
  @apply inline-flex items-center rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground transition-colors cursor-pointer;
}

.sp-period-selector__item:hover {
  @apply bg-background text-foreground;
}

.sp-period-selector__item--active {
  @apply bg-background shadow-sm text-foreground;
}

.sp-badge {
  @apply inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium;
}

.sp-badge--neutral {
  @apply border-slate-200 bg-slate-50 text-slate-600;
}

/* ── Page layout ───────────────────────────────────────── */

.sp-page-content {
  @apply p-4 max-w-7xl mx-auto flex flex-col gap-5;
}

.sp-page-content--sm {
  max-width: 760px;
}

.sp-content-wide {
  @apply p-4 max-w-7xl mx-auto;
}

.sp-content-narrow {
  @apply p-4 max-w-5xl mx-auto;
}

.sp-stack {
  @apply flex flex-col gap-4;
}

/* ── Grids ─────────────────────────────────────────────── */

.sp-grid {
  @apply grid gap-4;
}

.sp-grid--2 {
  @apply grid-cols-1 md:grid-cols-2;
}

.sp-grid--3 {
  @apply grid-cols-1 md:grid-cols-3;
}

.sp-grid--4 {
  @apply grid-cols-2 lg:grid-cols-4;
}

.sp-grid--sidebar {
  @apply grid-cols-1 lg:grid-cols-3;
}

/* ── Tabs (underline style) ────────────────────────────── */

.sp-tabs__nav {
  @apply border-b border-border;
}

.sp-tabs__item {
  @apply inline-flex items-center px-5 py-2.5 text-sm font-medium border-b-2 border-transparent text-muted-foreground transition-colors cursor-pointer bg-transparent;
  margin-bottom: -1px;
}

.sp-tabs__item:hover {
  @apply text-foreground;
}

.sp-tabs__item--active {
  @apply border-primary text-primary font-semibold;
}

.sp-card--tab-connected {
  @apply rounded-t-none border-t-0;
}

/* ── Quick links ───────────────────────────────────────── */

.sp-quick-links {
  @apply flex flex-col gap-0.5;
}

.sp-quick-links__item {
  @apply flex items-center gap-3 rounded-md px-3 py-2 text-sm text-muted-foreground transition-colors no-underline;
}

.sp-quick-links__item:hover {
  @apply bg-muted/50 text-foreground;
}

/* ── Metrics list ──────────────────────────────────────── */

.sp-metrics-list {
  @apply flex flex-col divide-y divide-border;
}

.sp-metrics-list__item {
  @apply flex items-center justify-between py-3;
}

.sp-metrics-list__label {
  @apply flex items-center gap-2 text-sm text-muted-foreground;
}

.sp-metrics-list__value {
  @apply text-sm font-semibold tabular-nums text-card-foreground;
}

/* ── States ────────────────────────────────────────────── */

.sp-state-loading,
.sp-state-empty {
  @apply p-8 text-center text-muted-foreground text-sm;
}

.sp-state-error {
  @apply p-8 text-center text-destructive text-sm;
}

/* ── Date badge ────────────────────────────────────────── */

.sp-date-badge {
  @apply flex items-center gap-2 text-sm text-muted-foreground border border-border rounded-lg px-3 py-1.5 bg-background;
}

/* ── Buttons (raw, outside WPSmartPayUI) ───────────────── */

.sp-btn {
  @apply inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors cursor-pointer border;
}

.sp-btn--primary {
  @apply bg-primary text-primary-foreground border-primary hover:opacity-90 px-4 py-2;
}

.sp-btn--outline {
  @apply bg-background text-foreground border-border hover:bg-muted px-4 py-2;
}

.sp-btn--ghost {
  @apply bg-transparent border-transparent text-muted-foreground hover:bg-muted hover:text-foreground px-4 py-2;
}

.sp-btn--destructive {
  @apply bg-destructive text-white border-destructive hover:opacity-90 px-4 py-2;
}

.sp-btn--sm {
  @apply px-3 py-1.5 text-xs;
}

.sp-btn--icon {
  @apply p-2 w-9 h-9;
}

.sp-btn:disabled {
  @apply opacity-40 cursor-not-allowed pointer-events-none;
}
