@layer reset, normalize, base, components, modules, utilities, native, platform;

/* Layers, not file names, decide precedence (Propshaft links every stylesheet
 * alphabetically, so file order is incidental):
 * - normalize (normalize.css) sits between reset.css and base.css.
 * - components.tables (tables.css) holds the shared data table; rules placed
 *   directly in `components` (page stylesheets) override it at any specificity. */
@layer components.tables;

:root {
  /* Spacing */
  --inline-space: 1ch;
  --inline-space-half: calc(var(--inline-space) / 2);
  --inline-space-double: calc(var(--inline-space) * 2);
  --block-space: 1rem;
  --block-space-half: calc(var(--block-space) / 2);
  --block-space-double: calc(var(--block-space) * 2);

  /* Text */
  --font-sans: "Inter Tight", "Adwaita Sans", -apple-system, BlinkMacSystemFont, "Segoe UI Variable iSamba", "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-serif: ui-serif, serif;
  --font-mono: ui-monospace, monospace;
  --font-display: "Space Grotesk", var(--font-sans);

  --text-xx-small: 0.55rem;
  --text-x-small: 0.75rem;
  --text-small: 0.85rem;
  --text-normal: 1rem;
  --text-medium: 1.1rem;
  --text-large: 1.5rem;
  --text-x-large: 1.8rem;
  --text-xx-large: 2.5rem;

  @media (max-width: 639px) {
    --text-xx-small: 0.65rem;
    --text-x-small: 0.85rem;
    --text-small: 0.95rem;
    --text-normal: 1.1rem;
    --text-medium: 1.2rem;
    --text-large: 1.5rem;
    --text-x-large: 1.8rem;
    --text-xx-large: 2.5rem;
  }

  /* Borders */
  --border: 1px solid var(--color-ink-lighter);

  /* Shadows */
  --shadow: 0 0 0 1px oklch(var(--lch-black) / 5%),
            0 0.2em 0.2em oklch(var(--lch-black) / 5%),
            0 0.4em 0.4em oklch(var(--lch-black) / 5%),
            0 0.8em 0.8em oklch(var(--lch-black) / 5%);

  /* Components */
  --btn-size: 2.65em;
  --footer-height: 2.65rem;
  --tray-size: clamp(12rem, 25dvw, 24rem);

  /* Focus rings for keyboard navigation */
  --focus-ring-color: var(--color-link);
  --focus-ring-offset: 1px;
  --focus-ring-size: 2px;
  --focus-ring: var(--focus-ring-size) solid var(--focus-ring-color);

  /* Dialogs */
  --dialog-duration: 150ms;

  /* Easing functions from https://easingwizard.com/ */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-overshoot: cubic-bezier(0.25, 1.75, 0.5, 1);
  --ease-out-overshoot-subtle: cubic-bezier(0.25, 1.25, 0.5, 1);

  @media (max-width: 799px) {
    --tray-size: var(--footer-height);
  }

  /* Layout */
  --main-padding: clamp(var(--inline-space), 3vw, calc(var(--inline-space) * 3));
  --main-width: 1400px;

  /* Z-index */
  --z-popup: 10;
  --z-nav: 20;
  --z-flash: 30;
  --z-tooltip: 40;
  --z-nav-open: 100;

  /* OKLCH colors: Fixed */
  --lch-black: 0% 0 0;
  --lch-white: 100% 0 0;

  /* OKLCH colors: Light mode */
  --lch-canvas: var(--lch-white);
  --lch-ink-inverted: var(--lch-white);

  --lch-ink-darkest: 26% 0.05 264;
  --lch-ink-darker: 40% 0.026 262;
  --lch-ink-dark: 56% 0.014 260;
  --lch-ink-medium: 66% 0.008 258;
  --lch-ink-light: 84% 0.005 256;
  --lch-ink-lighter: 92% 0.003 254;
  --lch-ink-lightest: 96% 0.002 252;

  --lch-uncolor-darkest: 26% 0.018 40;
  --lch-uncolor-darker: 40.04% 0.0376 50.06;
  --lch-uncolor-dark: 57.09% 0.0676 60.5;
  --lch-uncolor-medium: 66% 0.0944 71.46;
  --lch-uncolor-light: 83.97% 0.0457 80.84;
  --lch-uncolor-lighter: 92% 0.014 90;
  --lch-uncolor-lightest: 96% 0.012 100;

  --lch-red-darkest: 26% 0.105 34;
  --lch-red-darker: 40% 0.154 36;
  --lch-red-dark: 59% 0.19 38;
  --lch-red-medium: 66% 0.204 40;
  --lch-red-light: 84.08% 0.0837 41.96;
  --lch-red-lighter: 92% 0.03 44;
  --lch-red-lightest: 96% 0.013 46;

  --lch-yellow-darkest: 26% 0.0729 40;
  --lch-yellow-darker: 40% 0.12 50;
  --lch-yellow-dark: 58% 0.156 60;
  --lch-yellow-medium: 74% 0.184 70;
  --lch-yellow-light: 84% 0.12 80;
  --lch-yellow-lighter: 92% 0.076 90;
  --lch-yellow-lightest: 96% 0.034 100;

  --lch-lime-darkest: 26% 0.064 109;
  --lch-lime-darker: 40% 0.101 110;
  --lch-lime-dark: 56.5% 0.142 111;
  --lch-lime-medium: 68% 0.176 113.11;
  --lch-lime-light: 83.92% 0.0927 113.6;
  --lch-lime-lighter: 92% 0.046 114;
  --lch-lime-lightest: 96% 0.034 115;

  --lch-green-darkest: 26% 0.071 149;
  --lch-green-darker: 40% 0.12 148;
  --lch-green-dark: 55% 0.162 147;
  --lch-green-medium: 66% 0.208 146;
  --lch-green-light: 83.92% 0.0772 145.06;
  --lch-green-lighter: 92% 0.044 144;
  --lch-green-lightest: 96% 0.022 143;

  --lch-aqua-darkest: 26% 0.059 214;
  --lch-aqua-darker: 40% 0.093 212;
  --lch-aqua-dark: 55.5% 0.122 210;
  --lch-aqua-medium: 66% 0.152 208;
  --lch-aqua-light: 83.88% 0.0555 206.02;
  --lch-aqua-lighter: 92% 0.02 204;
  --lch-aqua-lightest: 96% 0.012 202;

  /* Brand palette, from the brandbook's "Paleta de cores" page:
   * blue #334FD7, coral #F67E65, lime #E0E447, lilac #C8B1FF. Blue is the
   * app's link and button color; coral, lime and lilac fill shapes and tags
   * that carry dark text (white on coral or lime text on white is unreadable). */
  --lch-brand-blue: 49.67% 0.2098 268.34;
  --lch-brand-coral: 72.44% 0.1523 33.06;
  --lch-brand-lime: 88.86% 0.1717 110.88;
  --lch-brand-lilac: 80.79% 0.1106 297.41;
  /* Coral deep enough for white text (5:1, #BB4D2F), for fills that carry it. */
  --lch-brand-coral-dark: 55.99% 0.1492 36.09;

  --lch-blue-darkest: 26% 0.126 264;
  --lch-blue-darker: 40% 0.166 262;
  --lch-blue-dark: var(--lch-brand-blue);
  --lch-blue-medium: 66% 0.196 257.82;
  --lch-blue-light: 84.04% 0.0719 255.29;
  --lch-blue-lighter: 92% 0.026 254;
  --lch-blue-lightest: 96% 0.016 252;

  --lch-violet-darkest: 26% 0.148 292;
  --lch-violet-darker: 40% 0.2 290;
  --lch-violet-dark: 58% 0.216 287.6;
  --lch-violet-medium: 66% 0.206 285.52;
  --lch-violet-light: 84.08% 0.0791 283.47;
  --lch-violet-lighter: 92% 0.03 282;
  --lch-violet-lightest: 96% 0.015 280;

  --lch-purple-darkest: 26% 0.131 314;
  --lch-purple-darker: 40% 0.178 312;
  --lch-purple-dark: 58% 0.21 310;
  --lch-purple-medium: 66% 0.258 308;
  --lch-purple-light: 84.09% 0.0778 305.77;
  --lch-purple-lighter: 92% 0.03 304;
  --lch-purple-lightest: 96% 0.019 302;

  --lch-pink-darkest: 26% 0.12 348;
  --lch-pink-darker: 40% 0.16 346;
  --lch-pink-dark: 59% 0.188 344;
  --lch-pink-medium: 71.8% 0.2008 342;
  --lch-pink-light: 84.04% 0.0737 340;
  --lch-pink-lighter: 92% 0.03 338;
  --lch-pink-lightest: 96% 0.02 336;

  /* Colors: Named */
  --color-black: oklch(var(--lch-black));
  --color-white: oklch(var(--lch-white));

  --color-ink: oklch(var(--lch-ink-darkest));
  --color-ink-darkest: oklch(var(--lch-ink-darkest));
  --color-ink-darker: oklch(var(--lch-ink-darker));
  --color-ink-dark: oklch(var(--lch-ink-dark));
  --color-ink-medium: oklch(var(--lch-ink-medium));
  --color-ink-light: oklch(var(--lch-ink-light));
  --color-ink-lighter: oklch(var(--lch-ink-lighter));
  --color-ink-lightest: oklch(var(--lch-ink-lightest));

  --color-ink-inverted: oklch(var(--lch-ink-inverted));

  /* Colors: Abstractions */
  --color-canvas: oklch(var(--lch-canvas));
  --color-negative: oklch(var(--lch-red-dark));
  --color-positive: oklch(var(--lch-green-dark));
  --color-link: oklch(var(--lch-blue-dark));
  --color-brand-coral: oklch(var(--lch-brand-coral));
  --color-brand-coral-dark: oklch(var(--lch-brand-coral-dark));
  --color-brand-lime: oklch(var(--lch-brand-lime));
  --color-brand-lilac: oklch(var(--lch-brand-lilac));
  --color-selected-light: oklch(var(--lch-blue-lightest));
  --color-selected: oklch(var(--lch-blue-lighter));
  --color-selected-dark: oklch(var(--lch-blue-light));
  --color-highlight: oklch(var(--lch-yellow-lighter));
  --color-marker: oklch(var(--lch-red-medium));
  --color-terminal-bg: oklch(98% 0.002 252);
  --color-terminal-text: var(--color-ink);
  --color-terminal-text-light: var(--color-ink-lighter);
  --color-golden: oklch(89.1% 0.178 95.7);
  --color-maybe: oklch(var(--lch-blue-medium));

  /* Colors: Brand scales
     Accent scales carried over from the former Tailwind theme. Neutrals map to
     the --color-ink-* scale above; reach for these only for brand/status accents. */
  --color-primary-50: #d9e8ff;
  --color-primary-100: #b0d0ff;
  --color-primary-200: #88b1fc;
  --color-primary-300: #5e8aee;
  --color-primary-400: #3a66db;
  --color-primary-500: #2251cc;
  --color-primary-600: #1d3dbf;
  --color-primary-700: #132dad;

  --color-success-50: oklch(0.979 0.021 166.113);
  --color-success-100: oklch(0.95 0.052 163.051);
  --color-success-400: oklch(0.765 0.177 163.223);
  --color-success-500: oklch(0.696 0.17 162.48);
  --color-success-600: oklch(0.596 0.145 163.225);
  --color-success-700: oklch(0.508 0.118 165.612);

  --color-danger-50: oklch(0.971 0.013 17.38);
  --color-danger-100: oklch(0.936 0.032 17.717);
  --color-danger-400: oklch(0.704 0.191 22.216);
  --color-danger-500: oklch(0.637 0.237 25.331);
  --color-danger-600: oklch(0.577 0.245 27.325);
  --color-danger-700: oklch(0.505 0.213 27.518);

  --color-warning-50: oklch(0.987 0.022 95.277);
  --color-warning-100: oklch(0.962 0.059 95.617);
  --color-warning-400: oklch(0.828 0.189 84.429);
  --color-warning-500: oklch(0.769 0.188 70.08);
  --color-warning-600: oklch(0.666 0.179 58.318);
  --color-warning-800: oklch(0.473 0.137 46.201);

  /* Elevation for flat white cards (dashboard tiles, list panels) */
  --shadow-raised: 0 2px 6px 0 oklch(var(--lch-black) / 5%);
  --shadow-overlay: 0 18px 28px 0 oklch(var(--lch-black) / 16%), 0 0 1px 0 oklch(var(--lch-black) / 32%);
  --color-scrim: oklch(37.2% 0.044 257.3 / 50%);

  /* Colors: Cards */
  --color-card-default: oklch(var(--lch-blue-dark));
  --color-card-complete: var(--color-ink-darker);

  /* Colors: Highlighter */
  --highlight-1: rgb(136, 118, 38);
  --highlight-2: rgb(185, 94, 6);
  --highlight-3: rgb(207, 0, 0);
  --highlight-4: rgb(216, 28, 170);
  --highlight-5: rgb(144, 19, 254);
  --highlight-6: rgb(5, 98, 185);
  --highlight-7: rgb(17, 138, 15);
  --highlight-8: rgb(148, 82, 22);
  --highlight-9: rgb(102, 102, 102);

  --highlight-bg-1: rgba(229, 223, 6, 0.3);
  --highlight-bg-2: rgba(255, 185, 87, 0.3);
  --highlight-bg-3: rgba(255, 118, 118, 0.3);
  --highlight-bg-4: rgba(248, 137, 216, 0.3);
  --highlight-bg-5: rgba(190, 165, 255, 0.3);
  --highlight-bg-6: rgba(124, 192, 252, 0.3);
  --highlight-bg-7: rgba(140, 255, 129, 0.3);
  --highlight-bg-8: rgba(221, 170, 123, 0.3);
  --highlight-bg-9: rgba(200, 200, 200, 0.3);

  /* Colors: Syntax highlighting */
  --color-code-token__att: oklch(var(--lch-blue-dark));
  --color-code-token__comment: oklch(var(--lch-ink-medium));
  --color-code-token__function: oklch(var(--lch-purple-dark));
  --color-code-token__operator: oklch(var(--lch-red-dark));
  --color-code-token__property: oklch(var(--lch-purple-dark));
  --color-code-token__punctuation: oklch(var(--lch-ink-dark));
  --color-code-token__selector: oklch(var(--lch-green-dark));
  --color-code-token__variable: oklch(var(--lch-red-dark));

  /* Colors: Generating gradient */
  --color-gradient-1: oklch(var(--lch-violet-lighter));
  --color-gradient-2: oklch(var(--lch-pink-lighter));
  --color-gradient-3: oklch(var(--lch-purple-lighter));
  --color-gradient-4: var(--color-canvas);
}
