@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import "tailwindcss";
@custom-variant dark (&:is(.dark *));

:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: #1a3a2e;
  --card: #ffffff;
  --card-foreground: #1a3a2e;
  --popover: #ffffff;
  --popover-foreground: #1a3a2e;
  --primary: #2d5a4a;
  --primary-foreground: #ffffff;
  --secondary: #e8f3f0;
  --secondary-foreground: #1a3a2e;
  --muted: #f0f5f3;
  --muted-foreground: #5a7a6f;
  --accent: #d4e8e1;
  --accent-foreground: #1a3a2e;
  --destructive: #d4183d;
  --destructive-foreground: #ffffff;
  --border: rgba(45, 90, 74, 0.15);
  --input: transparent;
  --input-background: #f7faf9;
  --switch-background: #b8cdc5;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: #5a9584;
  --chart-1: #5a9584;
  --chart-2: #7ab5a0;
  --chart-3: #3d6b5c;
  --chart-4: #9dc9b8;
  --chart-5: #2d5a4a;
  --radius: 0.625rem;
  --sidebar: #f7faf9;
  --sidebar-foreground: #1a3a2e;
  --sidebar-primary: #2d5a4a;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #e8f3f0;
  --sidebar-accent-foreground: #1a3a2e;
  --sidebar-border: rgba(45, 90, 74, 0.1);
  --sidebar-ring: #5a9584;
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --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.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(0.269 0 0);
  --sidebar-ring: oklch(0.439 0 0);
}

@theme inline {
  --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-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-input-background: var(--input-background);
  --color-switch-background: var(--switch-background);
  --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);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --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);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/**
 * Base typography. This is not applied to elements which have an ancestor with a Tailwind text class.
 */
@layer base {
  :where(:not(:has([class*=' text-']), :not(:has([class^='text-'])))) {
    h1 {
      font-size: var(--text-2xl);
      font-weight: 600;
      line-height: 1.3;
      letter-spacing: -0.02em;
    }

    h2 {
      font-size: var(--text-xl);
      font-weight: 600;
      line-height: 1.4;
      letter-spacing: -0.01em;
    }

    h3 {
      font-size: var(--text-lg);
      font-weight: 600;
      line-height: 1.4;
      letter-spacing: -0.01em;
    }

    h4 {
      font-size: var(--text-base);
      font-weight: 600;
      line-height: 1.5;
    }

    p {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.6;
    }

    label {
      font-size: var(--text-base);
      font-weight: 500;
      line-height: 1.5;
      letter-spacing: -0.005em;
    }

    button {
      font-size: var(--text-base);
      font-weight: 500;
      line-height: 1.5;
      letter-spacing: -0.005em;
    }

    input {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
    }
  }
}

html {
  font-size: var(--font-size);
}

.table-scroll {
  overflow: scroll;
  flex: 1;
}

.table-scroll::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.table-scroll::-webkit-scrollbar-track {
  background: var(--muted);
  border: 1px solid var(--border);
}

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 30px;
  min-height: 30px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--foreground);
}

/* Hide all buttons by default, then selectively show the correct one per end */
.table-scroll::-webkit-scrollbar-button {
  display: none;
}

/* Up arrow — top of vertical bar */
.table-scroll::-webkit-scrollbar-button:vertical:decrement:start {
  display: block;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px 999px 0 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 2 L7 6 L1 6 Z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 8px;
}

/* Down arrow — bottom of vertical bar */
.table-scroll::-webkit-scrollbar-button:vertical:increment:end {
  display: block;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0 0 999px 999px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 6 L7 2 L1 2 Z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 8px;
}

/* Left arrow — left end of horizontal bar */
.table-scroll::-webkit-scrollbar-button:horizontal:decrement:start {
  display: block;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px 0 0 999px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M2 4 L6 1 L6 7 Z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 8px;
}

/* Right arrow — right end of horizontal bar */
.table-scroll::-webkit-scrollbar-button:horizontal:increment:end {
  display: block;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0 999px 999px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M6 4 L2 1 L2 7 Z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 8px;
}

.table-scroll::-webkit-scrollbar-button:hover {
  background: var(--border);
}

.table-scroll::-webkit-scrollbar-corner {
  background: transparent;
}