diff --git a/.dockerignore b/.dockerignore index aa2e5b3..1e3739b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ # Keep the build context small and never ship secrets or local files. .git .github +.claude .gitignore .env .env.* @@ -16,6 +17,7 @@ bin staticfiles tests tailwind +docs compose.yaml Dockerfile .dockerignore diff --git a/.editorconfig b/.editorconfig index 1716961..0f4b4a0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,9 @@ insert_final_newline = true [*.{yml,yaml}] indent_size = 2 + +[*.html] +indent_size = 2 + +[*.css] +indent_size = 2 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5993bf0..954b491 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,3 +5,13 @@ updates: schedule: interval: "weekly" timezone: "America/Sao_Paulo" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + timezone: "America/Sao_Paulo" + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + timezone: "America/Sao_Paulo" diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..21d14ff --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,122 @@ +name: Publish + +# What reaches master (and every version tag) is tested again and, only if the +# tests pass, built for amd64 and arm64 and published to ghcr.io. +# +# Publishing is switched by the repository variable PUBLISH_IMAGE (Settings, +# Secrets and variables, Actions, Variables). Without it, for example on a fork, +# the image is still built and smoke-tested, but nothing is pushed. +on: + push: + branches: [master] + tags: ['v*'] + workflow_dispatch: + +concurrency: + group: publish-${{ github.ref }} + cancel-in-progress: false # never stop a publish half way + +permissions: + contents: read + +jobs: + tests: + uses: ./.github/workflows/tests.yaml + + image: + name: 🐳 Container image + needs: tests + runs-on: ubuntu-latest + timeout-minutes: 60 + + permissions: + contents: read + packages: write + + env: + PUBLISH: ${{ vars.PUBLISH_IMAGE == 'true' }} + + steps: + - name: πŸ“₯ Checkout repository + uses: actions/checkout@v5 + + - name: 🧬 Set up QEMU (for the arm64 build) + uses: docker/setup-qemu-action@v3 + + - name: πŸ—οΈ Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: πŸ”¨ Build the image (amd64) for the smoke test + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64 + load: true + push: false + tags: vault:ci + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: πŸ”Ž Smoke test the image + run: | + set -eu + env_args="-e SECRET_KEY=ci-only -e ALLOWED_HOSTS=localhost -e DATABASE_URL=postgres://u:p@localhost/x" + + echo "runs as the unprivileged user:" + test "$(docker run --rm vault:ci id -u)" = "10001" + + echo "the code is read-only for the app user:" + if docker run --rm vault:ci sh -c 'touch /app/probe'; then + echo "the app user can write to /app" >&2 + exit 1 + fi + + echo "starts with a read-only filesystem and any uid:" + docker run --rm --read-only --tmpfs /tmp --user 4242:4242 $env_args vault:ci python manage.py check + + echo "encrypted backups work (gnupg) with a read-only filesystem:" + docker run --rm --read-only --tmpfs /tmp $env_args vault:ci python -c " + import django, os + os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings' + django.setup() + from apps.core import backup + assert backup.decrypt(backup.encrypt(b'ok', 'a-long-passphrase-1'), 'a-long-passphrase-1') == b'ok'" + + - name: πŸ”‘ Log in to GitHub Container Registry + if: env.PUBLISH == 'true' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: 🏷️ Work out the image tags and labels + id: meta + if: env.PUBLISH == 'true' + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=edge,branch=master + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + labels: | + org.opencontainers.image.documentation=${{ github.server_url }}/${{ github.repository }}/blob/master/DOCKER.md + + - name: πŸš€ Build and push (amd64 and arm64) + if: env.PUBLISH == 'true' + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + provenance: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: ⏭️ Say why nothing was published + if: env.PUBLISH != 'true' + run: echo "::notice title=Image not published::Set the repository variable PUBLISH_IMAGE to true to publish it." diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..0c6dd29 --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,22 @@ +name: Pull request + +# Pull requests are only tested: nothing is built or published from here. +# +# It can also be run by hand on a branch (release.yaml does this for the release +# pull request, which GitHub does not test by itself): the check it reports is +# the same one that master requires before a merge. +on: + pull_request: + branches: [master] + workflow_dispatch: + +concurrency: + group: pull-request-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + tests: + uses: ./.github/workflows/tests.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..72ddc8d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,58 @@ +name: Release + +# Keeps a "release pull request" open on master: it holds the next version (in +# pyproject.toml) and the changelog, worked out from the Conventional Commits +# since the last release (feat = minor, fix = patch, "!" = major). Merging that +# pull request creates the tag vX.Y.Z and the GitHub release, and this workflow +# then starts publish.yaml for the tag. +# +# Anything created with the built-in GITHUB_TOKEN (the tag, the release pull +# request) does not trigger other workflows by itself (a GitHub rule, to avoid +# loops), so publish.yaml and the tests are started explicitly: workflow runs +# are the one exception to that rule. +on: + push: + branches: [master] + +concurrency: + group: release + cancel-in-progress: false + +permissions: + contents: write + issues: write + pull-requests: write + actions: write + +jobs: + release-please: + name: πŸ”– Release pull request + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: πŸ”– Update the release pull request, or tag a release + id: release + uses: googleapis/release-please-action@v4 + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + # The release pull request is opened with the built-in token, and GitHub + # does not run pull_request workflows for those. master requires the tests + # before a merge, so run them on the release branch by hand. + - name: πŸ§ͺ Run the tests on the release pull request + if: steps.release.outputs.prs_created == 'true' + env: + GH_TOKEN: ${{ github.token }} + PR: ${{ steps.release.outputs.pr }} + run: | + branch="$(echo "$PR" | jq -r .headBranchName)" + gh workflow run pull-request.yaml --repo "$GITHUB_REPOSITORY" --ref "$branch" + + - name: πŸš€ Publish the image for the new tag + if: steps.release.outputs.release_created == 'true' + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ steps.release.outputs.tag_name }} + run: gh workflow run publish.yaml --repo "$GITHUB_REPOSITORY" --ref "$TAG" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..a308fb1 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,54 @@ +name: Tests + +# Lint, Tailwind freshness check and the test suite. pull-request.yaml and +# publish.yaml call it, so there is one definition. It can also be run by hand +# from the Actions tab on any branch, without publishing anything. +on: + workflow_call: + workflow_dispatch: + +permissions: + contents: read + +env: + PYTHON_VERSION: '3.14' + TAILWIND_VERSION: '4.3.4' + +jobs: + test: + name: πŸ§ͺ Lint and tests + runs-on: ubuntu-latest + timeout-minutes: 20 + + env: + ENVIRONMENT: development + DATABASE_URL: postgres://user:password@localhost:5432/vault + SECRET_KEY: ci-only-secret-key + ALLOWED_HOSTS: localhost + + steps: + - name: πŸ“₯ Checkout repository + uses: actions/checkout@v5 + + - name: 🐍 Set up Python + uses: actions/setup-python@v6 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: πŸ“¦ Install Poetry + run: | + pipx install poetry + pipx inject poetry "poethepoet[poetry_plugin]" + + - name: πŸ”§ Install dependencies + run: poetry install + + - name: 🎨 Check Tailwind CSS is up to date + run: | + mkdir -p bin + curl -sL -o bin/tailwindcss "https://github.com/tailwindlabs/tailwindcss/releases/download/v${TAILWIND_VERSION}/tailwindcss-linux-x64" + chmod +x bin/tailwindcss + poetry css-check + + - name: πŸ§ͺ Run tests + run: poetry test diff --git a/.gitignore b/.gitignore index 0134ee2..1d6c45c 100644 --- a/.gitignore +++ b/.gitignore @@ -231,3 +231,8 @@ backup_*.sql # Tailwind standalone CLI binary (dev only) bin/ + +# Claude Code: the skills are local tools (their licenses are mixed or missing) +# and settings.local.json is personal, so neither is versioned. +.claude/skills/ +.claude/settings.local.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..37fcefa --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.0" +} diff --git a/CLAUDE.md b/CLAUDE.md index 54d093e..88a90c5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -64,7 +64,8 @@ Dev-only dependencies live in the Poetry `dev` group and are not needed to run t . β”œβ”€β”€ .github/ β”‚ β”œβ”€β”€ dependabot.yml # weekly pip updates (America/Sao_Paulo) -β”‚ └── workflows/ # pipeline.yaml (lint + tests + CSS freshness), docker.yaml (image to ghcr.io on v* tags) +β”‚ └── workflows/ # tests.yaml (reusable: lint + tests + CSS freshness), pull-request.yaml (tests only), +β”‚ # publish.yaml (master and v* tags: tests, then the image to ghcr.io), release.yaml (release-please) β”œβ”€β”€ config/ # settings.py, urls.py, wsgi.py β”œβ”€β”€ apps/ β”‚ β”œβ”€β”€ core/ # app-agnostic base: TimestampedModel, DomainError, error middleware, @@ -223,7 +224,9 @@ Install the plugin once: `pipx inject poetry "poethepoet[poetry_plugin]"` (quote Dev database: `docker compose up -d --wait` (`compose.yaml`, Postgres only). Download the Tailwind standalone binary for your OS from the tailwindlabs/tailwindcss releases into `bin/tailwindcss`. -Rebuild and commit the CSS whenever template classes change. +Rebuild and commit the CSS whenever template classes change. Tailwind scans only `templates/` and `apps/` (`source(none)` + +explicit `@source` lines in `tailwind/input.css`): without that it also scans notes and local tools, so the CSS built on +a machine differs from CI's and `css-check` fails. Classes used anywhere else need their folder added as an `@source`. To run it (any machine, Pi included): `poetry install --only main`. If Poetry is too heavy there, export requirements (`poetry-plugin-export`) and install with pip. @@ -260,6 +263,22 @@ requirements (`poetry-plugin-export`) and install with pip. `_id` attributes (`total: Decimal`, `item_id: int`); `class Meta(TimestampedModel.Meta)`; form fields are retyped with `core.forms.field_of(form, name, FieldClass)` instead of mutating `form.fields[...]`; no attributes monkey-patched onto model instances (use dataclass rows, template filters or `{% widthratio %}`). +- **UI/UX and accessibility** (found with the `ui-ux-pro-max` skill, which is optional and local: `.claude/skills/` is + not versioned, and everything it taught is written down here and covered by `tests/core/test_accessibility.py`): + - Text contrast >= 4.5:1 in both themes. Muted text is `text-stone-500 dark:text-stone-400` (`stone-500` is darkened in + `tailwind/input.css` for this); never `text-stone-400` alone in light mode or `dark:text-stone-500`. Filled buttons + use `bg-emerald-700` (white on `emerald-600` is only 3.8:1). + - Every page has the skip link and `
`; the active menu link carries `aria-current="page"` + (`{% nav_current '/prefix/' %}`); table header cells are ``. + - Form fields render through `partials/form_fields.html`: required marker, help text and error ids + (`-help` / `-error`), `aria-invalid` and `aria-describedby` (set by `StyledFormMixin`), and an error summary + when more than one field fails. Forms that share a page need distinct `auto_id` (see `ENTRY_IDS` in the inventory + views) so ids stay unique. + - Touch targets are 44 px on small screens (`min-h-11 sm:min-h-0`, `size-11 sm:size-9`). Decorative bars, rings and + heat maps are `aria-hidden` and have their numbers as text next to them. + - Motion respects `prefers-reduced-motion`. Forms disable their submit button after sending (`app.js`, htmx forms use + `hx-disabled-elt`) so a stock entry is never made twice. + - The mobile drawer is `inert` while closed, and the menu button keeps `aria-expanded` in sync. - No separator comments like `# --- Section ---`. No `# noqa`: ruff exceptions go in `pyproject.toml` (`PLR2004` is off for `tests/**` because tests compare with literal numbers). @@ -273,14 +292,31 @@ requirements (`poetry-plugin-export`) and install with pip. - Required env vars: `DATABASE_URL`, `SECRET_KEY`, `ALLOWED_HOSTS`; optional: `ENVIRONMENT` (default `development`), `EXPIRY_WARNING_DAYS` (default `90`), `CURRENCY_SYMBOL` (default `R$`). - **Commits**: Conventional Commits, lowercase, gerund verb, e.g. `feat(inventory): adding batch model` / `fix(core): fixing alert window calculation`. - Use `chore(deps):` / `build(deps):` for dependency changes. + Use `chore(deps):` / `build(deps):` for dependency changes. The commit type drives the version (see CI): `feat` = minor, + `fix` = patch, `!` or `BREAKING CHANGE:` = major, so pick it on purpose. ## CI -`.github/workflows/pipeline.yaml` on every push and PR: checkout, Python, Poetry + poe plugin, -`poetry install`, Tailwind freshness check (`poetry css-check`, binary pinned to v4.3.4), `poetry test`. Use plain literal env values for CI (never production -credentials). `DATABASE_URL` only needs to be a syntactically valid URL there, since -Testcontainers provides the real database. +Workflows in `.github/workflows/`. `tests.yaml` is reusable (`workflow_call`, and `workflow_dispatch` to test any branch by hand without publishing) and holds the one definition of the test job: +checkout, Python, Poetry + poe plugin, `poetry install`, Tailwind freshness check (`poetry css-check`, binary pinned to v4.3.4), +`poetry test`. `pull-request.yaml` (PRs into `master`) only calls it: PRs are tested, never built or published. +`release.yaml` (push to `master`) runs release-please: it keeps the release PR (next version in `pyproject.toml` + +`CHANGELOG.md`, from the Conventional Commits: feat = minor, fix = patch, `!` = major; config in +`release-please-config.json`, current version in `.release-please-manifest.json`), and when that PR is merged it tags +`vX.Y.Z` and starts `publish.yaml` for the tag with `gh workflow run` (a tag made by `GITHUB_TOKEN` does not trigger +workflows). Never edit the version or the changelog by hand. It needs the Actions setting "Allow GitHub Actions to create +and approve pull requests". `publish.yaml` (push to `master`, `v*` tags, manual) calls the tests, then job `image` (needs the tests) builds the image, +smoke-tests it (uid 10001, read-only code, read-only filesystem with an arbitrary uid, gpg backup) and pushes +`linux/amd64` + `linux/arm64` to `ghcr.io//` (`edge`, `sha-*`, semver, `latest`). Publishing needs the repository +variable `PUBLISH_IMAGE=true` (without it the image is built and smoke-tested only, with a notice). Tool versions (Python, +Tailwind) live in the `env:` block of `tests.yaml`. No GitHub `secrets` are used: CI values are throwaway literals, and the +only credential is the built-in `GITHUB_TOKEN`; add real secrets only to a protected Environment. `master` is protected by a ruleset ("master protection", no bypass): no deletion, no force push, merge only through a PR +whose check `tests / πŸ§ͺ Lint and tests` passed. That name is ` / ` (`tests` in +`pull-request.yaml` + the job name in `tests.yaml`): rename either and the ruleset must follow. `release.yaml` dispatches +`pull-request.yaml` on the release branch, because PRs opened with `GITHUB_TOKEN` get no `pull_request` runs. Never push to +`master` directly. Keep `DOCKER.md` (the +registry-style page) in sync with the Dockerfile and the env vars. Use plain literal env values for CI (never production +credentials). `DATABASE_URL` only needs to be a syntactically valid URL there, since Testcontainers provides the real database. ## Running it (any machine; notes for the Raspberry Pi) @@ -306,7 +342,8 @@ Testcontainers provides the real database. the redirect off. `createsuperuser` still works. - Docker: `docker build -t vault .` then `docker run` with `SECRET_KEY`, `ALLOWED_HOSTS`, `DATABASE_URL` (PostgreSQL is not in the image). Multi-stage `python:3.14-slim`, runtime deps only, `gnupg`, static files collected - at build time, non-root user, TCP health check. `RUN_MIGRATIONS=1` runs `migrate` on start (off by default). The + at build time, runs as uid/gid 10001 (system user, no home, no shell), code owned by root and read-only, works with + `--read-only --tmpfs /tmp` and any uid, TCP health check. See `DOCKER.md`. `RUN_MIGRATIONS=1` runs `migrate` on start (off by default). The first-time setup code appears in `docker logs`. - Plain HTTP on the LAN: cookies are not marked `Secure`. Reach it from outside only through a VPN. - Backups are made on demand from the Settings page (see Domain rules). Keep the passphrase somewhere safe and copy diff --git a/DOCKER.md b/DOCKER.md new file mode 100644 index 0000000..1d30d58 --- /dev/null +++ b/DOCKER.md @@ -0,0 +1,201 @@ +# V.A.U.L.T + +**V**erified **A**ssets, **U**sage, **L**ots and **T**racking: a self-hosted, offline-first inventory manager for food, water, supplies, medications, ammunition and preparedness gear. It tracks what you have, where it is, when it expires and how long it will last, and tells you when something needs attention. + +- **Image:** `ghcr.io/buguno/vault` +- **Source code and full documentation:** +- **Supported architectures:** `linux/amd64` and `linux/arm64` (a 64-bit Raspberry Pi works; 32-bit systems do not) +- **Maintained by:** [buguno](https://github.com/buguno) + +> **Security first.** V.A.U.L.T holds sensitive data (medications, ammunition) and speaks plain HTTP. Run it on a network you trust and **never expose it directly to the internet**. To reach it from outside, use a VPN such as WireGuard or Tailscale. + +## Tags + +| Tag | Meaning | +| --- | --- | +| `latest` | The most recent release. | +| `1.2.3` | An exact release (recommended for production: it never changes). | +| `1.2` | The latest patch of a minor release. | +| `edge` | The `master` branch: newest code, may be unstable. | +| `sha-abc1234` | One exact commit. | + +Release tags (`latest`, `1.2.3`, `1.2`) appear when a release is made: the automation opens a release pull request from the commit history, and merging it tags `v1.2.3` and publishes the image. Release candidates such as `1.3.0-rc.1` get only their own tag, never `latest` or `1.3`. + +## Quick start + +The app needs a **PostgreSQL** database; the image does not include one. The easiest way is Docker Compose, which starts both. + +**1. Create a `.env` file** next to the compose file (no quotes around the values): + +```bash +SECRET_KEY=paste-a-long-random-value-here +DB_PASSWORD=paste-another-random-value-here +``` + +Generate good values with: + +```bash +echo "SECRET_KEY=$(openssl rand -base64 48 | tr -d '\n')" +echo "DB_PASSWORD=$(openssl rand -hex 24)" +``` + +**2. Save this as `compose.yaml`:** + +```yaml +services: + db: + image: postgres:17 + restart: unless-stopped + environment: + POSTGRES_USER: vault + POSTGRES_PASSWORD: ${DB_PASSWORD:?set DB_PASSWORD in .env} + POSTGRES_DB: vault + volumes: + - vault-db:/var/lib/postgresql/data + healthcheck: + test: ['CMD-SHELL', 'pg_isready -U vault -d vault'] + interval: 5s + timeout: 3s + retries: 10 + + app: + image: ghcr.io/buguno/vault:latest + restart: unless-stopped + depends_on: + db: + condition: service_healthy + ports: + - '8000:8000' + environment: + SECRET_KEY: ${SECRET_KEY:?set SECRET_KEY in .env} + ALLOWED_HOSTS: localhost,127.0.0.1 + DATABASE_URL: postgres://vault:${DB_PASSWORD}@db:5432/vault + RUN_MIGRATIONS: '1' + read_only: true + tmpfs: + - /tmp + security_opt: + - no-new-privileges:true + cap_drop: + - ALL + +volumes: + vault-db: +``` + +**3. Start it and read the first-time setup code:** + +```bash +docker compose up -d +docker compose logs app | grep -A3 "first-time setup" +``` + +**4. Open .** There are no users yet, so the site asks for the setup code printed in the logs, a username and a password, and creates the administrator. After that the setup page is closed for good. + +To open it from a phone or another computer, add the host's address to `ALLOWED_HOSTS` (for example `localhost,192.168.0.10`) and use `http://192.168.0.10:8000`. + +## Running with `docker run` + +With a PostgreSQL you already have (here on the host, reached by `host.docker.internal`): + +```bash +docker run -d --name vault \ + -p 8000:8000 \ + -e SECRET_KEY='a-long-random-value' \ + -e ALLOWED_HOSTS='localhost,192.168.0.10' \ + -e DATABASE_URL='postgres://user:password@host.docker.internal:5432/vault' \ + -e RUN_MIGRATIONS=1 \ + --read-only --tmpfs /tmp \ + --security-opt no-new-privileges:true --cap-drop ALL \ + --restart unless-stopped \ + ghcr.io/buguno/vault:latest + +docker logs vault # the first-time setup code is printed here +``` + +- **`localhost` inside the container is the container itself**, not your machine. A `DATABASE_URL` that says `localhost` fails with `Connection refused`. Use the database's service name (Compose), `host.docker.internal` (Docker Desktop; on Linux add `--add-host=host.docker.internal:host-gateway`) or the other machine's address. +- On Linux, a PostgreSQL on the host must accept connections from the Docker network (not only from `127.0.0.1`). + +## Environment variables + +Set them with `-e`, with `environment:` in Compose, or with `--env-file` / `env_file:`. In an env file write `NAME=value` **without quotes**: Docker keeps the quotes as part of the value. + +| Variable | Required | Default | What it does | +| --- | --- | --- | --- | +| `SECRET_KEY` | **yes** | | Django's secret key. Use a long random value and keep it private: the first-time setup code is derived from it. Changing it signs everyone out. | +| `DATABASE_URL` | **yes** | | PostgreSQL connection, e.g. `postgres://user:password@host:5432/dbname`. Percent-encode special characters in the password (or use hex). | +| `ALLOWED_HOSTS` | **yes** | | Comma-separated host names and addresses the site answers to, e.g. `localhost,192.168.0.10,vault.local`. A request with any other `Host` is refused (`DisallowedHost`). | +| `RUN_MIGRATIONS` | no | `0` | Set to `1` to apply database migrations every time the container starts. Convenient for a single container; leave it off if you prefer to migrate by hand. | +| `EXPIRY_WARNING_DAYS` | no | `90` | How many days ahead a batch counts as "expiring soon". | +| `CURRENCY_SYMBOL` | no | `R$` | Symbol shown next to prices and values (one currency, no conversion). | +| `ENVIRONMENT` | no | `production` | Already `production` in the image. Only change it for debugging: `development` turns `DEBUG` on. | +| `GUNICORN_BIND` | no | `0.0.0.0:8000` | Address and port inside the container. If you change the port, also change the published port. | +| `GUNICORN_WORKERS` | no | `1` | Worker processes. One is enough for a household and keeps RAM low. | +| `GUNICORN_THREADS` | no | `2` | Threads per worker. | +| `GUNICORN_TIMEOUT` | no | `30` | Worker timeout, in seconds. | +| `GUNICORN_LOG_LEVEL` | no | `info` | `debug`, `info`, `warning`, `error` or `critical`. | + +## Data and volumes + +The container is **stateless**: it keeps nothing on disk, so there is no volume to mount for it and you can recreate it freely. **All data is in PostgreSQL**, so persist that database (the `vault-db` volume above) and back it up. + +The application also makes encrypted backups from its **Settings** page (administrators only): one GnuPG-encrypted file with all the data, protected by a passphrase you type each time and that is never stored. Download it and keep it, with the passphrase, somewhere safe off the machine. + +## Users and permissions inside the container + +- The app runs as an **unprivileged user** `vault` (uid and gid **10001**), a system account with no home directory, no password and no login shell. It never runs as root. +- The application code belongs to `root` and **nobody can write to it**, so a compromised process cannot change the app. +- The app only writes to `/tmp` (a throwaway directory while making a backup) and to `/dev/shm` (gunicorn's heartbeat). That is why `--read-only --tmpfs /tmp` works, and it is the recommended way to run it. +- It also works with an **arbitrary user id** (`--user 1234:1234`, as some platforms force): everything it needs is world-readable. +- No capabilities are needed: `--cap-drop ALL` and `--security-opt no-new-privileges:true` are safe. + +## Health check + +The image declares a `HEALTHCHECK` (a TCP connection to the app's port every 30 seconds). `docker ps` shows `healthy` once the app is up, and Compose can wait for it with `depends_on: condition: service_healthy`. + +## Ports + +| Port | Use | +| --- | --- | +| `8000` | The web interface (HTTP). | + +Put a reverse proxy in front only inside a trusted network. The app does not mark cookies as `Secure`, because it is meant for plain HTTP on a LAN. + +## Raspberry Pi + +The image is built for `arm64`, so it runs on a Raspberry Pi 3, 4, 5 or Zero 2 W with a **64-bit** operating system. It is light by design (one gunicorn worker and PostgreSQL). On a small board, tune PostgreSQL for about 512 MB of RAM (for example `shared_buffers=32MB`, `work_mem=2MB`, `max_connections=20`) and use a good SD card or an SSD. + +## Upgrading + +1. Export an encrypted backup from the Settings page. +2. Pull the new image and recreate the container: + ```bash + docker compose pull app + docker compose up -d app + ``` + With `RUN_MIGRATIONS=1` the database is migrated on start. Otherwise run it once by hand: `docker compose run --rm app python manage.py migrate`. +3. Pin an exact tag such as `1.2.3` if you want upgrades to happen only when you decide. + +## Useful commands + +```bash +docker compose logs -f app # follow the logs +docker compose exec app python manage.py createsuperuser # another administrator +docker compose exec app python manage.py changepassword NAME # reset a password +docker compose exec app python manage.py migrate # apply migrations by hand +``` + +## Building the image yourself + +```bash +git clone https://github.com/buguno/vault.git +cd vault +docker build -t vault . + +# both architectures (needs buildx and QEMU) +docker buildx build --platform linux/amd64,linux/arm64 -t vault . +``` + +## License + +MIT. See the [LICENSE](https://github.com/buguno/vault/blob/master/LICENSE). diff --git a/Dockerfile b/Dockerfile index d6532be..e2c89fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + # build: install the runtime dependencies into a virtualenv FROM python:3.14-slim AS build @@ -21,6 +23,10 @@ RUN /opt/poetry/bin/poetry install --only main --no-root --no-interaction # run: a small image with just the app FROM python:3.14-slim +LABEL org.opencontainers.image.title="V.A.U.L.T" \ + org.opencontainers.image.description="Self-hosted, offline-first inventory manager for food, water, medications, ammunition and preparedness gear." \ + org.opencontainers.image.licenses="MIT" + ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ VIRTUAL_ENV=/opt/venv \ @@ -28,37 +34,49 @@ ENV PYTHONUNBUFFERED=1 \ ENVIRONMENT=production # gnupg is what the encrypted backup (Settings page) uses. +# The app runs as a fixed, unprivileged user (uid/gid 10001): a system account +# with no home directory, no shell and no password. +ARG UID=10001 +ARG GID=10001 RUN apt-get update \ && apt-get install -y --no-install-recommends gnupg \ && rm -rf /var/lib/apt/lists/* \ - && useradd --create-home --uid 1000 vault \ - && mkdir /app \ - && chown vault:vault /app + && groupadd --system --gid ${GID} vault \ + && useradd --system --uid ${UID} --gid ${GID} \ + --no-create-home --home-dir /nonexistent \ + --shell /usr/sbin/nologin vault COPY --from=build /opt/venv /opt/venv +# The code belongs to root and nobody can write to it: the app user only reads +# it, so a compromised process cannot change the application. The only places +# the app writes are /tmp (backups, in a throwaway directory) and /dev/shm +# (gunicorn heartbeat), which is why the container also runs with a read-only +# filesystem. WORKDIR /app -COPY --chown=vault:vault manage.py gunicorn.conf.py ./ -COPY --chown=vault:vault config ./config -COPY --chown=vault:vault apps ./apps -COPY --chown=vault:vault templates ./templates -COPY --chown=vault:vault static ./static -COPY --chown=vault:vault locale ./locale -COPY --chown=vault:vault --chmod=755 docker-entrypoint.sh /usr/local/bin/ - -USER vault +COPY manage.py gunicorn.conf.py ./ +COPY config ./config +COPY apps ./apps +COPY templates ./templates +COPY static ./static +COPY locale ./locale +COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/ # Gather the static files now, so nothing has to run before the first start. # The values are throwaway: collectstatic never touches the database. RUN SECRET_KEY=build-only ALLOWED_HOSTS=localhost \ DATABASE_URL=postgres://build:build@localhost/build \ - python manage.py collectstatic --noinput + python manage.py collectstatic --noinput \ + && chmod -R a+rX,go-w /app + +USER vault EXPOSE 8000 # The app answers on its port (a plain TCP check: no Host header to allow). +# It follows GUNICORN_BIND when the port is changed. HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ - CMD python -c "import socket; socket.create_connection(('127.0.0.1', 8000), 3)" + CMD python -c "import os, socket; port = os.environ.get('GUNICORN_BIND', '0.0.0.0:8000').rsplit(':', 1)[1]; socket.create_connection(('127.0.0.1', int(port)), 3)" ENTRYPOINT ["docker-entrypoint.sh"] CMD ["gunicorn", "config.wsgi:application", "--config", "gunicorn.conf.py"] diff --git a/README.md b/README.md index e3a84d2..b8ad5df 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Interface languages: **PortuguΓͺs (Brasil)** (default) and **English (US)**. Lig | **FEFO** | "First expired, first out". Taking stock out always uses the batch that expires first, then the oldest packaged. You can also choose a location to take from. | | **Alerts as notifications** | A bell in the menu with a counter, plus a page that lists expired or expiring batches, items below their minimum stock and kits that are incomplete or hold expired items. They clear themselves when you fix the cause. | | **Dashboard** | A greeting with a one-line summary, totals, what is expiring, what is below minimum, kits status, autonomy rings and bars per category. | -| **Shopping list** | Everything below its minimum stock with the amount to buy and a price estimate. Prints cleanly. | +| **Shopping list** | Everything below its minimum stock with the amount to buy and a price estimate. Downloads as a PDF. | | **Insights** | Forecast (how many days each item lasts at its recent pace), stock value per category, and activity (movement mix, who recorded, most used items and a 12-week heat map). | | **Stock count** | Count a location's shelves, type the numbers, and only the batches that differ are adjusted and logged. | | **CSV import** | Load a first inventory (or a big shopping trip) from a spreadsheet, all or nothing. | @@ -155,7 +155,7 @@ An entry can carry a **unit cost** (price paid per unit). It is blended into the ### Shopping list -`/shopping/` lists every item below its minimum stock and how much to buy to reach it. The estimate uses the last known unit cost of each item. Use **Print** for a paper copy (the menu and buttons disappear and the light theme is used). +`/shopping/` lists every item below its minimum stock and how much to buy to reach it. The estimate uses the last known unit cost of each item. Use **Download PDF** (`/shopping/pdf/`) for a paper copy: an A4 PDF with the table and a box to tick for each item, generated on the server. ### Insights @@ -196,7 +196,7 @@ An ammunition item has caliber, bullet weight (in grains), bullet type and manuf A kit owns one location (created from the kit's name unless you pick a free one) and a list of items with required quantities. A line is **complete** when the *usable* (not expired) stock **at that location** reaches the required quantity. A kit is **ready** when every line is complete and nothing in it is expired. Expiring stock is flagged but does not block "ready". To complete a kit, transfer stock into its location. -A kit's location is skipped by automatic exits (see [Taking stock out](#taking-stock-out-fefo)). You can still take from it by choosing it in **Take from**, and the notifications tell you when a kit becomes incomplete. On the kit page, **Print** gives a clean checklist with a box to tick for each line. +A kit's location is skipped by automatic exits (see [Taking stock out](#taking-stock-out-fefo)). You can still take from it by choosing it in **Take from**, and the notifications tell you when a kit becomes incomplete. On the kit page, **Download PDF** (`/kits//pdf/`) gives a checklist with a box to tick for each line. ### Autonomy @@ -366,7 +366,7 @@ Middleware, in order: security, WhiteNoise, sessions, locale, common, CSRF, auth Pages are rendered on the server. HTMX swaps the stock panel after an entry, exit, adjustment or transfer, and `static/js/app.js` lets validation (422) and rule (409) responses be swapped in. Modals use the native `` element. The sidebar drawer, dropdown menu and language selector are a few lines of plain JavaScript. -The look is a floating glass sidebar and top bar over a soft green gradient, in light and dark. The gray scale is overridden in `tailwind/input.css` with a slightly green tint, so every `stone-*` class picks it up. Charts (donuts, bars, the heat map) are plain CSS: no charting library. Printing is handled with Tailwind's `print:` variants, and `app.js` switches to the light theme while printing. Accounts marked read-only get `data-readonly` on ``, and a CSS rule hides POST forms and anything marked `data-write`. +The look is a floating glass sidebar and top bar over a soft green gradient, in light and dark. The gray scale is overridden in `tailwind/input.css` with a slightly green tint, so every `stone-*` class picks it up. Charts (donuts, bars, the heat map) are plain CSS: no charting library. PDFs (shopping list, kit checklist) are written by `apps/core/pdf.py`, a small writer with no library: standard Helvetica (not embedded, widths in `pdf_metrics.py`), Windows-1252 text, A4 pages that repeat the table header. It costs no extra RAM or dependency, but it only does simple tables. Accounts marked read-only get `data-readonly` on ``, and a CSS rule hides POST forms and anything marked `data-write`. --- @@ -376,7 +376,7 @@ The look is a floating glass sidebar and top bar over a soft green gradient, in . β”œβ”€β”€ .github/ β”‚ β”œβ”€β”€ dependabot.yml # weekly pip updates (America/Sao_Paulo) -β”‚ └── workflows/ # pipeline.yaml (CI) and docker.yaml (image to ghcr.io) +β”‚ └── workflows/ # tests.yaml (reusable), pull-request.yaml, publish.yaml (master and tags), release.yaml β”œβ”€β”€ config/ # settings.py, urls.py, wsgi.py, asgi.py β”œβ”€β”€ apps/ β”‚ β”œβ”€β”€ core/ # base, profile, settings page, notifications, backup @@ -590,6 +590,8 @@ poetry prod ### Docker +> The page you would find on a registry (how to run it, every environment variable, tags, permissions, upgrading) is [DOCKER.md](DOCKER.md). + A `Dockerfile` builds an image that runs the app with gunicorn, so you can run it on any machine that has Docker, Raspberry Pi included. It does **not** include PostgreSQL: point `DATABASE_URL` at a database the container can reach. You can build the image yourself, or pull the published one from the GitHub Container Registry when the project publishes it (see [Continuous integration](#continuous-integration)): `docker pull ghcr.io//vault:latest`. It is built for `linux/amd64` and `linux/arm64` (a 64-bit Raspberry Pi), and it contains no secrets: everything is configured at run time. @@ -614,7 +616,7 @@ docker logs vault # the first-time setup code is printed here - **Environment file:** do not pass your development `.env` with `--env-file`. Docker keeps the quotes around values literally, so `ENVIRONMENT="development"` becomes the text `"development"` (not development) and `ALLOWED_HOSTS` and `DATABASE_URL` break. Write a separate file without quotes, one `NAME=value` per line, and keep it out of git. - **Migrations:** `RUN_MIGRATIONS=1` applies them on every start. It is off by default, so you decide when the schema changes; run them once by hand with `docker run --rm ... vault python manage.py migrate`. - **First user:** the setup code is printed to the container's output, so read it with `docker logs vault` (see [First user](#first-user)). -- **What is inside:** `python:3.14-slim`, only the runtime dependencies (no Poetry, no test tools), `gnupg` for backups, and static files already collected, so nothing has to run before the first start. It runs as a non-root user (uid 1000), and its health check is a TCP connection to port 8000. The image is about 330 MB. +- **What is inside:** `python:3.14-slim`, only the runtime dependencies (no Poetry, no test tools), `gnupg` for backups, and static files already collected, so nothing has to run before the first start. It runs as an unprivileged user (uid and gid 10001, no home, no shell), the code is owned by root and read-only for that user, and it works with `--read-only --tmpfs /tmp` and with any uid. Its health check is a TCP connection to the app's port. The image is about 330 MB. - **State:** the container keeps no data. Everything is in PostgreSQL, so you can recreate the container freely. Backups are downloaded from the Settings page as before. - **Configuration:** it is the same environment variables as everywhere else (`ENVIRONMENT` is already `production` in the image), and the `GUNICORN_*` variables work too. Never put real secrets in the image or in a committed file: pass them at run time or through an env file (`--env-file`). - **Upgrading:** export a backup, `git pull`, `docker build -t vault .`, then start the new container with `RUN_MIGRATIONS=1`. @@ -650,10 +652,51 @@ It serves plain HTTP on your LAN, so cookies are not marked `Secure`. Put it beh ## Continuous integration -`.github/workflows/pipeline.yaml` runs on every push and pull request: checkout, Python 3.14, Poetry and the poe plugin, `poetry install`, the Tailwind freshness check (`poetry css-check`, binary pinned to v4.3.4) and `poetry test`. -Docker is available on the runner, so Testcontainers provides the database. The environment values there are plain literals (never real credentials); `DATABASE_URL` only needs to be a valid URL because the tests start their own database. Dependabot opens weekly updates for pip. +Three workflows in `.github/workflows/`; the test steps are written once, in a reusable workflow, and called by the other two. + +| Workflow | Runs on | What it does | +| --- | --- | --- | +| `tests.yaml` | called by the others; also **by hand** on any branch (Actions tab, *Tests*, *Run workflow*) | **Lint and tests:** checkout, Python 3.14, Poetry and the poe plugin, `poetry install`, the Tailwind freshness check (`poetry css-check`, binary pinned to v4.3.4) and `poetry test`. | +| `pull-request.yaml` | every pull request into `master` | **Only tests.** Nothing is built or published. A new push to the PR cancels the run in progress. | +| `release.yaml` | push to `master` | Keeps the **release pull request** up to date and, when it is merged, tags the release (see [Releases](#releases)). | +| `publish.yaml` | push to `master`, version tags `v*`, manual run | Runs the tests again and, **only if they pass**, builds the **container image**, smoke-tests it and publishes it. | + +Docker is available on the runner, so Testcontainers provides the database. The environment values there are plain literals (never real credentials); `DATABASE_URL` only needs to be a valid URL because the tests start their own database. Dependabot opens weekly updates for pip, GitHub Actions and the Docker base image. + +**The container image** (job `image` of `publish.yaml`): builds the image, runs a smoke test (runs as uid 10001, the code is read-only, it starts with a read-only filesystem and an arbitrary uid, encrypted backups work) and publishes it for `linux/amd64` and `linux/arm64` to **GitHub Container Registry** (`ghcr.io//`). + +| Event | Tags published | +| --- | --- | +| push to `master` | `edge`, `sha-` | +| tag `v1.2.3` | `1.2.3`, `1.2`, `latest`, `sha-` | + +It logs in with the built-in `GITHUB_TOKEN`, so no secret has to be created (and none is used: the only values in the workflows are throwaway ones for the tests). **Publishing is switched by the repository variable `PUBLISH_IMAGE`** (*Settings, Secrets and variables, Actions, Variables*; or `gh variable set PUBLISH_IMAGE --body true`). Without it, for example on a fork, the image is still built and smoke-tested but nothing is pushed, and the run shows a notice saying why. The Python and Tailwind versions used by CI are defined once in the `env:` block at the top of `tests.yaml`. The package is linked to the repository automatically (OCI source label). **The first publish creates a private package**: open the package on GitHub (profile, Packages, `vault`), then *Package settings*, *Change visibility* to Public so anyone can pull it, and check that the repository is listed under *Manage Actions access* with write access. The package page shows this repository's README; [DOCKER.md](DOCKER.md) is the registry-style page and is linked from the image's `documentation` label. + +### Releases + +Versions are not edited by hand. **release-please** reads the [Conventional Commits](https://www.conventionalcommits.org/) on `master` and keeps one pull request open, *chore(master): release X.Y.Z*, that holds the next version (in `pyproject.toml`) and the `CHANGELOG.md`: + +| Commit | Next version | In the changelog | +| --- | --- | --- | +| `fix(...)` | patch (1.1.0 β†’ 1.1.1) | Bug fixes | +| `feat(...)` | minor (1.1.0 β†’ 1.2.0) | Features | +| `feat(...)!` or a `BREAKING CHANGE:` footer | major (1.1.0 β†’ 2.0.0) | Features, flagged | +| `refactor`, `perf`, `docs` | none by themselves | listed when a release happens | +| `build`, `ci`, `chore`, `style`, `test` | none | hidden | + +When you merge that pull request, release-please creates the tag `vX.Y.Z` and the GitHub release, and `release.yaml` starts `publish.yaml` for the tag, which publishes `X.Y.Z`, `X.Y` and `latest` (see [DOCKER.md](DOCKER.md)). So a release is: merge pull requests, then merge the release pull request when you want to ship. + +One setting is needed once: *Settings, Actions, General, Workflow permissions*, tick **Allow GitHub Actions to create and approve pull requests** (or `gh api -X PUT repos///actions/permissions/workflow -f default_workflow_permissions=read -F can_approve_pull_request_reviews=true`). Because the release pull request is opened with the built-in token, GitHub does not run the pull-request tests on it; it only changes the version and the changelog. To force a version, put `Release-As: 2.0.0` in a commit body. + +### Branch protection + +`master` is protected by a repository ruleset (*Settings, Rules, Rulesets, master protection*) that nobody can bypass: + +- **It cannot be deleted** and its history cannot be rewritten (no force push). +- **Changes only arrive through a pull request** (no review is required, since the project has one maintainer). +- **A pull request can only be merged after the check `tests / πŸ§ͺ Lint and tests` passes** (lint, Tailwind freshness and the test suite). -`.github/workflows/docker.yaml` builds the image for `linux/amd64` and `linux/arm64` and publishes it to **GitHub Container Registry** (`ghcr.io//`) when you push a version tag such as `v1.2.0` (tags `1.2.0`, `1.2` and `latest`), or when you run it by hand from the Actions tab (tag `edge`). It logs in with the built-in `GITHUB_TOKEN`, so no secret needs to be created. New packages start private: change the visibility under the package's settings on GitHub if you want others to pull it without logging in. +The release pull request is opened with the built-in token, which GitHub does not test, so `release.yaml` runs `pull-request.yaml` on its branch by hand; that reports the same check. If the check ever has to be renamed (the job name in `tests.yaml` or the caller job in `pull-request.yaml`), update the ruleset too, or every merge stays blocked waiting for it. --- diff --git a/apps/core/forms.py b/apps/core/forms.py index 307d762..75ce3bc 100644 --- a/apps/core/forms.py +++ b/apps/core/forms.py @@ -25,12 +25,45 @@ class StyledFormMixin(forms.BaseForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - for field in self.fields.values(): + for name, field in self.fields.items(): if isinstance(field.widget, forms.CheckboxInput): field.widget.attrs.setdefault('class', 'checkbox') else: field.widget.attrs.setdefault('class', 'input') + self._describe(name) + + def full_clean(self): + super().full_clean() + + for name in self.fields: + self._describe(name) + + def _describe(self, name: str) -> None: + """Point a field at its help text and error message (`aria-*`). + + The templates render them with the ids `-help` and + `-error`. + """ + field = self.fields[name] + field_id = self[name].id_for_label + attrs = field.widget.attrs + described = [] + + if field.help_text: + described.append(f'{field_id}-help') + + if self._errors and name in self._errors: + described.append(f'{field_id}-error') + attrs['aria-invalid'] = 'true' + else: + attrs.pop('aria-invalid', None) + + if described: + attrs['aria-describedby'] = ' '.join(described) + else: + attrs.pop('aria-describedby', None) + class LoginForm(StyledFormMixin, AuthenticationForm): pass diff --git a/apps/core/pdf.py b/apps/core/pdf.py new file mode 100644 index 0000000..b04954a --- /dev/null +++ b/apps/core/pdf.py @@ -0,0 +1,310 @@ +"""A tiny PDF writer for simple tables, with no third-party library. + +It draws a title, a subtitle and a table on A4 pages using the standard PDF +fonts Helvetica and Helvetica-Bold, which every viewer has, so nothing is +embedded. Text is encoded as Windows-1252 (Portuguese and English are fine; +characters outside it become `?`). Long tables continue on new pages and repeat +the header. +""" + +from collections.abc import Sequence +from dataclasses import dataclass + +from apps.core.pdf_metrics import FIRST_CODE, HELVETICA, HELVETICA_BOLD + +PAGE_WIDTH = 595 +PAGE_HEIGHT = 842 +MARGIN = 42 +TITLE_SIZE = 20 +SUBTITLE_SIZE = 10 +TEXT_SIZE = 10 +HEADER_SIZE = 9 +ROW_HEIGHT = 24 +BASELINE_OFFSET = 9 # from the bottom of a row to its text +CELL_PADDING = 4 +BOX_SIZE = 9 +BOX_COLUMN = 22 +ELLIPSIS = '…' +INK = '0 g' +MUTED = '0.45 g' +RULE = '0.8 G' + + +@dataclass(frozen=True) +class Column: + title: str + weight: float = 1.0 # share of the table width + align_right: bool = False + + +@dataclass(frozen=True) +class Heading: + title: str + subtitle: str + + +@dataclass(frozen=True) +class Style: + size: float = TEXT_SIZE + bold: bool = False + color: str = INK + + +def text_width(text: str, size: float, bold: bool = False) -> float: + """Width of `text` in points when set in Helvetica at `size`.""" + widths = HELVETICA_BOLD if bold else HELVETICA + data = text.encode('cp1252', errors='replace') + units = sum( + widths[code - FIRST_CODE] if code >= FIRST_CODE else 0 for code in data + ) + + return units * size / 1000 + + +def fit(text: str, size: float, room: float, bold: bool = False) -> str: + """`text` cut with an ellipsis so it is not wider than `room`.""" + if text_width(text, size, bold) <= room: + return text + + while text and text_width(text + ELLIPSIS, size, bold) > room: + text = text[:-1] + + return text + ELLIPSIS + + +def _escape(text: str) -> bytes: + data = text.encode('cp1252', errors='replace') + + return ( + data + .replace(b'\\', b'\\\\') + .replace(b'(', b'\\(') + .replace(b')', b'\\)') + ) + + +class _Page: + """The drawing commands of one page, from the top down.""" + + def __init__(self) -> None: + self.commands: list[bytes] = [] + self.y = PAGE_HEIGHT - MARGIN + + def text(self, x: float, y: float, text: str, style: Style) -> None: + """A line of text with its baseline at `y`.""" + font = b'F2' if style.bold else b'F1' + self.commands.append( + b'BT %s /%s %.1f Tf %.2f %.2f Td (' + % (style.color.encode(), font, style.size, x, y) + + _escape(text) + + b') Tj ET' + ) + + def line(self, y: float, width: float = 0.5) -> None: + """A rule across the table at height `y`.""" + self.commands.append( + b'%s %.2f w %.2f %.2f m %.2f %.2f l S' + % (RULE.encode(), width, MARGIN, y, PAGE_WIDTH - MARGIN, y) + ) + + def box(self, x: float, y: float) -> None: + """An empty square to tick.""" + self.commands.append( + b'0.4 G 0.7 w %.2f %.2f %d %d re S' % (x, y, BOX_SIZE, BOX_SIZE) + ) + + +class TablePdf: + """Builds a one-table document; see `table_pdf` for the usual call.""" + + def __init__( + self, heading: Heading, columns: Sequence[Column], checkboxes: bool + ) -> None: + self.heading = heading + self.columns = columns + self.checkboxes = checkboxes + self.pages: list[_Page] = [] + self.edges = self._column_edges() + self._new_page(first=True) + + def _column_edges(self) -> list[tuple[float, float]]: + left = MARGIN + (BOX_COLUMN if self.checkboxes else 0) + room = PAGE_WIDTH - MARGIN - left + weights = sum(column.weight for column in self.columns) + edges = [] + + for column in self.columns: + width = room * column.weight / weights + edges.append((left, left + width)) + left += width + + return edges + + @property + def page(self) -> _Page: + return self.pages[-1] + + def _new_page(self, first: bool = False) -> None: + self.pages.append(_Page()) + + if first: + self._heading() + + self._header() + + def _heading(self) -> None: + self.page.y -= TITLE_SIZE + self.page.text( + MARGIN, + self.page.y, + self.heading.title, + Style(TITLE_SIZE, bold=True), + ) + + self.page.y -= SUBTITLE_SIZE + 6 + subtitle = fit( + self.heading.subtitle, SUBTITLE_SIZE, PAGE_WIDTH - 2 * MARGIN + ) + self.page.text( + MARGIN, self.page.y, subtitle, Style(SUBTITLE_SIZE, color=MUTED) + ) + + self.page.y -= 22 + + def _cell(self, index: int, y: float, text: str, style: Style) -> None: + left, right = self.edges[index] + room = right - left - 2 * CELL_PADDING + text = fit(text, style.size, room, style.bold) + + if self.columns[index].align_right: + width = text_width(text, style.size, style.bold) + x = right - CELL_PADDING - width + else: + x = left + CELL_PADDING + + self.page.text(x, y, text, style) + + def _header(self) -> None: + baseline = self.page.y - ROW_HEIGHT + BASELINE_OFFSET + style = Style(HEADER_SIZE, bold=True, color=MUTED) + + for index, column in enumerate(self.columns): + self._cell(index, baseline, column.title, style) + + self.page.y -= ROW_HEIGHT + self.page.line(self.page.y, 0.8) + + def _make_room(self) -> None: + if self.page.y - ROW_HEIGHT < MARGIN: + self._new_page() + + def row(self, cells: Sequence[str]) -> None: + self._make_room() + baseline = self.page.y - ROW_HEIGHT + BASELINE_OFFSET + + for index, text in enumerate(cells): + style = Style(bold=index == 0, color=INK if index == 0 else MUTED) + self._cell(index, baseline, text, style) + + self.page.y -= ROW_HEIGHT + self.page.line(self.page.y) + + def checkbox(self) -> None: + """A box to tick, for the row that was just added.""" + y = self.page.y + (ROW_HEIGHT - BOX_SIZE) / 2 + self.page.box(MARGIN + 2, y) + + def total(self, label: str, value: str) -> None: + """A bold last line: the label ends where the last column starts.""" + self._make_room() + baseline = self.page.y - ROW_HEIGHT + BASELINE_OFFSET + style = Style(bold=True) + last_left, _ = self.edges[-1] + label_width = text_width(label, style.size, style.bold) + + self.page.text( + last_left - label_width - CELL_PADDING, baseline, label, style + ) + self._cell(len(self.columns) - 1, baseline, value, style) + self.page.y -= ROW_HEIGHT + + def render(self) -> bytes: + objects: list[bytes] = [ + b'<< /Type /Catalog /Pages 2 0 R >>', + b'', # the page tree, filled in once the pages are known + b'<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica ' + b'/Encoding /WinAnsiEncoding >>', + b'<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold ' + b'/Encoding /WinAnsiEncoding >>', + ] + kids = [] + + for page in self.pages: + stream = b'\n'.join(page.commands) + objects.append( + b'<< /Length %d >>\nstream\n%s\nendstream' + % (len(stream), stream) + ) + contents = len(objects) + objects.append( + b'<< /Type /Page /Parent 2 0 R ' + b'/MediaBox [0 0 %d %d] ' + b'/Resources << /Font << /F1 3 0 R /F2 4 0 R >> >> ' + b'/Contents %d 0 R >>' % (PAGE_WIDTH, PAGE_HEIGHT, contents) + ) + kids.append(b'%d 0 R' % len(objects)) + + objects[1] = b'<< /Type /Pages /Kids [%s] /Count %d >>' % ( + b' '.join(kids), + len(kids), + ) + + return _serialize(objects) + + +def _serialize(objects: list[bytes]) -> bytes: + """The objects as a file: header, body, cross-reference table, trailer.""" + out = bytearray(b'%PDF-1.4\n') + offsets = [] + + for number, body in enumerate(objects, start=1): + offsets.append(len(out)) + out += b'%d 0 obj\n%s\nendobj\n' % (number, body) + + xref = len(out) + out += b'xref\n0 %d\n0000000000 65535 f \n' % (len(objects) + 1) + + for offset in offsets: + out += b'%010d 00000 n \n' % offset + + out += b'trailer\n<< /Size %d /Root 1 0 R >>\n' % (len(objects) + 1) + out += b'startxref\n%d\n%%%%EOF\n' % xref + + return bytes(out) + + +def table_pdf( + heading: Heading, + columns: Sequence[Column], + rows: Sequence[Sequence[str]], + total: tuple[str, str] | None = None, + checkboxes: bool = False, +) -> bytes: + """A PDF with a title, a subtitle and one table. + + `rows` hold one string per column. `total` is an optional last line as + `(label, value)`, the value under the last column. With `checkboxes`, + every row starts with a box to tick. + """ + document = TablePdf(heading, columns, checkboxes) + + for cells in rows: + document.row(cells) + + if checkboxes: + document.checkbox() + + if total: + document.total(*total) + + return document.render() diff --git a/apps/core/pdf_metrics.py b/apps/core/pdf_metrics.py new file mode 100644 index 0000000..7fd65b1 --- /dev/null +++ b/apps/core/pdf_metrics.py @@ -0,0 +1,461 @@ +"""Character widths (1/1000 em) of the standard PDF fonts Helvetica and +Helvetica-Bold for the Windows-1252 codes 32 to 255 (0 where undefined). + +Taken from the official Adobe font metrics, so text can be measured and +aligned without any library.""" + +FIRST_CODE = 32 + +HELVETICA = ( + 278, + 278, + 355, + 556, + 556, + 889, + 667, + 191, + 333, + 333, + 389, + 584, + 278, + 333, + 278, + 278, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 278, + 278, + 584, + 584, + 584, + 556, + 1015, + 667, + 667, + 722, + 722, + 667, + 611, + 778, + 722, + 278, + 500, + 667, + 556, + 833, + 722, + 778, + 667, + 778, + 722, + 667, + 611, + 722, + 667, + 944, + 667, + 667, + 611, + 278, + 278, + 278, + 469, + 556, + 333, + 556, + 556, + 500, + 556, + 556, + 278, + 556, + 556, + 222, + 222, + 500, + 222, + 833, + 556, + 556, + 556, + 556, + 333, + 500, + 278, + 556, + 500, + 722, + 500, + 500, + 500, + 334, + 260, + 334, + 584, + 761, + 556, + 0, + 222, + 556, + 333, + 1000, + 556, + 556, + 333, + 1000, + 667, + 333, + 1000, + 0, + 611, + 0, + 0, + 222, + 222, + 333, + 333, + 350, + 556, + 1000, + 333, + 1000, + 500, + 333, + 944, + 0, + 500, + 667, + 278, + 333, + 556, + 556, + 556, + 556, + 260, + 556, + 333, + 737, + 370, + 556, + 584, + 333, + 737, + 333, + 400, + 584, + 333, + 333, + 333, + 556, + 537, + 278, + 333, + 333, + 365, + 556, + 834, + 834, + 834, + 611, + 667, + 667, + 667, + 667, + 667, + 667, + 1000, + 722, + 667, + 667, + 667, + 667, + 278, + 278, + 278, + 278, + 722, + 722, + 778, + 778, + 778, + 778, + 778, + 584, + 778, + 722, + 722, + 722, + 722, + 667, + 667, + 611, + 556, + 556, + 556, + 556, + 556, + 556, + 889, + 500, + 556, + 556, + 556, + 556, + 278, + 278, + 278, + 278, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 584, + 611, + 556, + 556, + 556, + 556, + 500, + 556, + 500, +) + +HELVETICA_BOLD = ( + 278, + 333, + 474, + 556, + 556, + 889, + 722, + 238, + 333, + 333, + 389, + 584, + 278, + 333, + 278, + 278, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 556, + 333, + 333, + 584, + 584, + 584, + 611, + 975, + 722, + 722, + 722, + 722, + 667, + 611, + 778, + 722, + 278, + 556, + 722, + 611, + 833, + 722, + 778, + 667, + 778, + 722, + 667, + 611, + 722, + 667, + 944, + 667, + 667, + 611, + 333, + 278, + 333, + 584, + 556, + 333, + 556, + 611, + 556, + 611, + 556, + 333, + 611, + 611, + 278, + 278, + 556, + 278, + 889, + 611, + 611, + 611, + 611, + 389, + 556, + 333, + 611, + 556, + 778, + 556, + 556, + 500, + 389, + 280, + 389, + 584, + 761, + 556, + 0, + 278, + 556, + 500, + 1000, + 556, + 556, + 333, + 1000, + 667, + 333, + 1000, + 0, + 611, + 0, + 0, + 278, + 278, + 500, + 500, + 350, + 556, + 1000, + 333, + 1000, + 556, + 333, + 944, + 0, + 500, + 667, + 278, + 333, + 556, + 556, + 556, + 556, + 280, + 556, + 333, + 737, + 370, + 556, + 584, + 333, + 737, + 333, + 400, + 584, + 333, + 333, + 333, + 611, + 556, + 278, + 333, + 333, + 365, + 556, + 834, + 834, + 834, + 611, + 722, + 722, + 722, + 722, + 722, + 722, + 1000, + 722, + 667, + 667, + 667, + 667, + 278, + 278, + 278, + 278, + 722, + 722, + 778, + 778, + 778, + 778, + 778, + 584, + 778, + 722, + 722, + 722, + 722, + 667, + 667, + 611, + 556, + 556, + 556, + 556, + 556, + 556, + 889, + 556, + 556, + 556, + 556, + 556, + 278, + 278, + 278, + 278, + 611, + 611, + 611, + 611, + 611, + 611, + 611, + 584, + 611, + 611, + 611, + 611, + 611, + 556, + 611, + 556, +) diff --git a/apps/core/responses.py b/apps/core/responses.py new file mode 100644 index 0000000..81f46d0 --- /dev/null +++ b/apps/core/responses.py @@ -0,0 +1,9 @@ +from django.http import HttpResponse + + +def pdf_response(data: bytes, filename: str) -> HttpResponse: + """A PDF the browser downloads under `filename`.""" + response = HttpResponse(data, content_type='application/pdf') + response['Content-Disposition'] = f'attachment; filename="{filename}"' + + return response diff --git a/apps/core/templatetags/nav.py b/apps/core/templatetags/nav.py index b93202f..e4d3b2a 100644 --- a/apps/core/templatetags/nav.py +++ b/apps/core/templatetags/nav.py @@ -1,4 +1,5 @@ from django import template +from django.utils.safestring import mark_safe register = template.Library() @@ -12,8 +13,20 @@ ) +def _is_active(context, prefix) -> bool: + path = context['request'].path + + return path == '/' if prefix == '/' else path.startswith(prefix) + + @register.simple_tag(takes_context=True) def nav_class(context, prefix): - path = context['request'].path - active = path == '/' if prefix == '/' else path.startswith(prefix) - return ACTIVE if active else IDLE + return ACTIVE if _is_active(context, prefix) else IDLE + + +@register.simple_tag(takes_context=True) +def nav_current(context, prefix): + """`aria-current` for the active link, so it is not told by color alone.""" + return ( + mark_safe('aria-current="page"') if _is_active(context, prefix) else '' + ) diff --git a/apps/inventory/reports.py b/apps/inventory/reports.py new file mode 100644 index 0000000..2efee7e --- /dev/null +++ b/apps/inventory/reports.py @@ -0,0 +1,49 @@ +from datetime import date +from decimal import Decimal + +from django.utils.formats import date_format +from django.utils.translation import gettext as _ + +from apps.core.pdf import Column, Heading, table_pdf +from apps.core.templatetags.money import money +from apps.inventory.services import ShoppingLine + + +def _plain(quantity: Decimal) -> str: + return format(quantity.normalize(), 'f') + + +def shopping_list_pdf( + lines: list[ShoppingLine], estimate: Decimal, today: date +) -> bytes: + """The shopping list as a PDF, with a box to tick for each item.""" + columns = [ + Column(_('Item'), 3), + Column(_('Category'), 2), + Column(_('Have'), 1.4, align_right=True), + Column(_('Minimum'), 1.2, align_right=True), + Column(_('Buy'), 1.4, align_right=True), + Column(_('Estimate'), 1.6, align_right=True), + ] + rows = [] + + for line in lines: + unit = str(line.item.unit_symbol) + rows.append([ + line.item.name, + line.item.category.name, + f'{_plain(line.total)} {unit}', + _plain(line.item.min_stock), + f'{_plain(line.missing)} {unit}', + money(line.estimate) if line.estimate is not None else 'β€”', + ]) + + heading = Heading(_('Shopping list'), date_format(today, _('l, F j, Y'))) + + return table_pdf( + heading, + columns, + rows, + total=(_('Estimated total'), money(estimate)) if estimate else None, + checkboxes=True, + ) diff --git a/apps/inventory/urls.py b/apps/inventory/urls.py index 77880d1..a8f71b3 100644 --- a/apps/inventory/urls.py +++ b/apps/inventory/urls.py @@ -25,6 +25,7 @@ ), path('movements/', views.movement_list, name='movement_list'), path('shopping/', views.shopping_list, name='shopping_list'), + path('shopping/pdf/', views.shopping_pdf, name='shopping_pdf'), path('insights/', views.insights, name='insights'), path('count/', views.stock_count, name='stock_count'), path('import/', views.stock_import, name='stock_import'), diff --git a/apps/inventory/views.py b/apps/inventory/views.py index ceba713..76e75fc 100644 --- a/apps/inventory/views.py +++ b/apps/inventory/views.py @@ -19,7 +19,8 @@ from django.views.generic import CreateView, ListView, UpdateView from apps.core.htmx import is_htmx -from apps.inventory import extensions, imports, services +from apps.core.responses import pdf_response +from apps.inventory import extensions, imports, reports, services from apps.inventory import insights as insight_data from apps.inventory.forms import ( AdjustForm, @@ -40,6 +41,8 @@ ) from apps.inventory.services import EntryDetails +ENTRY_IDS = 'entry-%s' +EXIT_IDS = 'exit-%s' PAGE_SIZE = 20 MOVEMENT_PAGE_SIZE = 30 RECENT_MOVEMENTS = 10 @@ -194,6 +197,14 @@ class BatchRow: transfer_form: TransferForm +def _adjust_ids(batch: Batch) -> str: + return f'adjust-{batch.pk}-%s' + + +def _transfer_ids(batch: Batch) -> str: + return f'transfer-{batch.pk}-%s' + + def _batch_rows(item: Item, forms: StockForms) -> list[BatchRow]: today = timezone.localdate() limit = _expiry_limit() @@ -217,13 +228,18 @@ def _batch_rows(item: Item, forms: StockForms) -> list[BatchRow]: forms.adjust if has_errors and forms.adjust else AdjustForm( - initial={'new_quantity': _plain(batch.quantity)} + auto_id=_adjust_ids(batch), + initial={'new_quantity': _plain(batch.quantity)}, ) ), transfer_form=( forms.transfer if has_errors and forms.transfer - else TransferForm(batch=batch, initial=quantity) + else TransferForm( + batch=batch, + auto_id=_transfer_ids(batch), + initial=quantity, + ) ), ) ) @@ -242,8 +258,8 @@ def _stock_response(request, item, forms=None, status=HTTPStatus.OK): 'low': total < item.min_stock, 'rows': rows, 'next_batch': next((r.batch for r in rows if not r.reserved), None), - 'entry_form': forms.entry or EntryForm(), - 'exit_form': forms.exit or ExitForm(item=item), + 'entry_form': forms.entry or EntryForm(auto_id=ENTRY_IDS), + 'exit_form': forms.exit or ExitForm(item=item, auto_id=EXIT_IDS), 'movements': services.recent_movements(item, RECENT_MOVEMENTS), } @@ -274,7 +290,7 @@ def _after_success(request, item, message): @require_POST def item_entry(request, pk): item = get_object_or_404(Item, pk=pk) - form = EntryForm(request.POST) + form = EntryForm(request.POST, auto_id=ENTRY_IDS) if not form.is_valid(): return _stock_response( @@ -303,7 +319,7 @@ def item_entry(request, pk): @require_POST def item_exit(request, pk): item = get_object_or_404(Item, pk=pk) - form = ExitForm(request.POST, item=item) + form = ExitForm(request.POST, item=item, auto_id=EXIT_IDS) if not form.is_valid(): return _stock_response( @@ -328,7 +344,7 @@ def item_exit(request, pk): @require_POST def batch_adjust(request, pk): batch = get_object_or_404(Batch.objects.select_related('item'), pk=pk) - form = AdjustForm(request.POST) + form = AdjustForm(request.POST, auto_id=_adjust_ids(batch)) if not form.is_valid(): return _stock_response( @@ -351,7 +367,9 @@ def batch_transfer(request, pk): batch = get_object_or_404( Batch.objects.select_related('item', 'location'), pk=pk ) - form = TransferForm(request.POST, batch=batch) + form = TransferForm( + request.POST, batch=batch, auto_id=_transfer_ids(batch) + ) if not form.is_valid(): return _stock_response( @@ -497,18 +515,30 @@ def export_stock_csv(request): return response -def shopping_list(request): +def _shopping_context() -> dict: lines = services.shopping_list() priced = [line.estimate for line in lines if line.estimate is not None] - context = { + return { 'lines': lines, 'estimate': sum(priced, Decimal(0)), 'unpriced': len(lines) - len(priced), 'today': timezone.localdate(), } - return render(request, 'inventory/shopping_list.html', context) + +def shopping_list(request): + return render(request, 'inventory/shopping_list.html', _shopping_context()) + + +def shopping_pdf(request): + context = _shopping_context() + today = context['today'] + data = reports.shopping_list_pdf( + context['lines'], context['estimate'], today + ) + + return pdf_response(data, f'shopping-list-{today.isoformat()}.pdf') INSIGHT_TABS = ('forecast', 'value', 'activity') diff --git a/apps/kits/reports.py b/apps/kits/reports.py new file mode 100644 index 0000000..4e6ef69 --- /dev/null +++ b/apps/kits/reports.py @@ -0,0 +1,38 @@ +from decimal import Decimal + +from django.utils.translation import gettext as _ + +from apps.core.pdf import Column, Heading, table_pdf +from apps.kits.services import KitStatus + + +def _plain(quantity: Decimal) -> str: + return format(quantity.normalize(), 'f') + + +def kit_checklist_pdf(status: KitStatus) -> bytes: + """A kit's checklist as a PDF, with a box to tick for each line.""" + kit = status.kit + columns = [ + Column(_('Item'), 4), + Column(_('In the kit'), 2, align_right=True), + Column(_('Required'), 2, align_right=True), + ] + rows = [] + + for line in status.lines: + unit = str(line.item.unit_symbol) + rows.append([ + line.item.name, + f'{_plain(line.valid)} {unit}', + f'{_plain(line.required)} {unit}', + ]) + + subtitle = kit.location.name + + if kit.description: + subtitle = f'{subtitle} Β· {kit.description}' + + return table_pdf( + Heading(kit.name, subtitle), columns, rows, checkboxes=True + ) diff --git a/apps/kits/urls.py b/apps/kits/urls.py index 395e3fd..84dddeb 100644 --- a/apps/kits/urls.py +++ b/apps/kits/urls.py @@ -8,6 +8,7 @@ path('kits/', views.kit_list, name='list'), path('kits/new/', views.kit_create, name='create'), path('kits//', views.kit_detail, name='detail'), + path('kits//pdf/', views.kit_pdf, name='pdf'), path('kits//edit/', views.kit_update, name='update'), path('kits//delete/', views.kit_delete, name='delete'), path('kits//items/', views.kit_item_set, name='item_set'), diff --git a/apps/kits/views.py b/apps/kits/views.py index 2d1d967..a062f28 100644 --- a/apps/kits/views.py +++ b/apps/kits/views.py @@ -3,10 +3,12 @@ from django.contrib import messages from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse +from django.utils.text import slugify from django.utils.translation import gettext as _ from django.views.decorators.http import require_POST -from apps.kits import services +from apps.core.responses import pdf_response +from apps.kits import reports, services from apps.kits.forms import KitForm, KitItemForm from apps.kits.models import Kit, KitItem @@ -65,6 +67,13 @@ def _detail_response(request, kit, form=None, status=HTTPStatus.OK): return render(request, 'kits/detail.html', context, status=status) +def kit_pdf(request, pk): + kit = get_object_or_404(Kit.objects.select_related('location'), pk=pk) + data = reports.kit_checklist_pdf(services.kit_status(kit)) + + return pdf_response(data, f'kit-{slugify(kit.name)}.pdf') + + def kit_detail(request, pk): kit = get_object_or_404(Kit.objects.select_related('location'), pk=pk) return _detail_response(request, kit) diff --git a/gunicorn.conf.py b/gunicorn.conf.py index 64d057a..0648665 100644 --- a/gunicorn.conf.py +++ b/gunicorn.conf.py @@ -8,7 +8,7 @@ import os from pathlib import Path -bind = os.environ.get('GUNICORN_BIND', '0.0.0.0:8000') # noqa: S104 +bind = os.environ.get('GUNICORN_BIND', '0.0.0.0:8000') workers = int(os.environ.get('GUNICORN_WORKERS', '1')) threads = int(os.environ.get('GUNICORN_THREADS', '2')) worker_class = 'gthread' diff --git a/locale/pt_BR/LC_MESSAGES/django.mo b/locale/pt_BR/LC_MESSAGES/django.mo index eb250b6..b639dc2 100644 Binary files a/locale/pt_BR/LC_MESSAGES/django.mo and b/locale/pt_BR/LC_MESSAGES/django.mo differ diff --git a/locale/pt_BR/LC_MESSAGES/django.po b/locale/pt_BR/LC_MESSAGES/django.po index c426370..2de274a 100644 --- a/locale/pt_BR/LC_MESSAGES/django.po +++ b/locale/pt_BR/LC_MESSAGES/django.po @@ -714,6 +714,30 @@ msgstr "movimentaΓ§Γ£o de estoque" msgid "stock movements" msgstr "movimentaΓ§Γ΅es de estoque" +msgid "Category" +msgstr "Categoria" + +msgid "Have" +msgstr "Tenho" + +msgid "Minimum" +msgstr "MΓ­nimo" + +msgid "Buy" +msgstr "Comprar" + +msgid "Estimate" +msgstr "Estimativa" + +msgid "Shopping list" +msgstr "Lista de compras" + +msgid "l, F j, Y" +msgstr "l, j \\d\\e F \\d\\e Y" + +msgid "Estimated total" +msgstr "Total estimado" + msgid "The manufacture date cannot be in the future." msgstr "A data de fabricaΓ§Γ£o nΓ£o pode estar no futuro." @@ -846,9 +870,6 @@ msgstr "Local atualizado." msgid "Location deleted." msgstr "Local excluΓ­do." -msgid "Category" -msgstr "Categoria" - msgid "Unit" msgstr "Unidade" @@ -905,6 +926,12 @@ msgstr "item do kit" msgid "kit items" msgstr "itens do kit" +msgid "In the kit" +msgstr "No kit" + +msgid "Required" +msgstr "NecessΓ‘rio" + #, python-format msgid "Location \"%(name)s\" already belongs to another kit." msgstr "O local \"%(name)s\" jΓ‘ pertence a outro kit." @@ -1161,6 +1188,9 @@ msgstr "" msgid "Details" msgstr "Detalhes" +msgid "Skip to main content" +msgstr "Pular para o conteΓΊdo" + msgid "Preparedness inventory" msgstr "InventΓ‘rio de preparo" @@ -1311,12 +1341,6 @@ msgstr[1] "%(n)s itens estΓ£o abaixo do mΓ­nimo." msgid "Everything is in order." msgstr "Tudo em ordem." -msgid "l, F j, Y" -msgstr "l, j \\d\\e F \\d\\e Y" - -msgid "Shopping list" -msgstr "Lista de compras" - msgid "Insights" msgstr "AnΓ‘lises" @@ -1502,9 +1526,6 @@ msgstr "Nenhuma movimentaΓ§Γ£o ainda." msgid "Stock" msgstr "Estoque" -msgid "Minimum" -msgstr "MΓ­nimo" - msgid "Next expiry" msgstr "PrΓ³x. validade" @@ -1589,20 +1610,8 @@ msgstr "MovimentaΓ§Γ΅es recentes" msgid "Everything below its minimum stock, with the amount to buy." msgstr "Tudo o que estΓ‘ abaixo do estoque mΓ­nimo, com a quantidade a comprar." -msgid "Print" -msgstr "Imprimir" - -msgid "Have" -msgstr "Tenho" - -msgid "Buy" -msgstr "Comprar" - -msgid "Estimate" -msgstr "Estimativa" - -msgid "Estimated total" -msgstr "Total estimado" +msgid "Download PDF" +msgstr "Baixar PDF" #, python-format msgid "%(n)s item without a known price" @@ -1713,12 +1722,6 @@ msgstr "Progresso" msgid "Checklist" msgstr "Checklist" -msgid "In the kit" -msgstr "No kit" - -msgid "Required" -msgstr "NecessΓ‘rio" - msgid "OK" msgstr "OK" @@ -1778,6 +1781,9 @@ msgstr "Nenhum medicamento ainda." msgid "Strength" msgstr "ConcentraΓ§Γ£o" +msgid "Fix these fields:" +msgstr "Corrija estes campos:" + msgid "Overview" msgstr "VisΓ£o geral" diff --git a/pyproject.toml b/pyproject.toml index d8550c3..53adfad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] line-length = 79 -extend-exclude = ['migrations'] +extend-exclude = ['migrations', '.claude'] [tool.ruff.lint] preview = true diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..4f770aa --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "python", + "package-name": "vault", + "include-v-in-tag": true, + "changelog-path": "CHANGELOG.md", + "changelog-sections": [ + { "type": "feat", "section": "Features" }, + { "type": "fix", "section": "Bug fixes" }, + { "type": "perf", "section": "Performance" }, + { "type": "refactor", "section": "Refactoring" }, + { "type": "docs", "section": "Documentation" }, + { "type": "build", "section": "Build and dependencies", "hidden": true }, + { "type": "ci", "section": "Continuous integration", "hidden": true }, + { "type": "chore", "section": "Chores", "hidden": true }, + { "type": "style", "section": "Style", "hidden": true }, + { "type": "test", "section": "Tests", "hidden": true } + ] + } + } +} diff --git a/static/css/tailwind.css b/static/css/tailwind.css index 65f3f6c..8556fe4 100644 --- a/static/css/tailwind.css +++ b/static/css/tailwind.css @@ -1,2 +1,2 @@ /*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-emerald-950:oklch(26.2% .051 172.552);--color-teal-400:oklch(77.7% .152 181.912);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-200:oklch(90.1% .058 230.902);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-900:oklch(39.1% .09 240.876);--color-stone-50:#f6f9f7;--color-stone-100:#ecf1ee;--color-stone-200:#dbe3de;--color-stone-300:#bcc9c1;--color-stone-400:#8c9d93;--color-stone-500:#66786d;--color-stone-600:#4f5f55;--color-stone-700:#3a473f;--color-stone-800:#26312b;--color-stone-900:#17201b;--color-stone-950:#0b110e;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components{.card{border-radius:var(--radius-2xl);border-style:var(--tw-border-style);border-width:1px;border-color:#dbe3decc}@supports (color:color-mix(in lab, red, red)){.card{border-color:color-mix(in oklab, var(--color-stone-200) 80%, transparent)}}.card{background-color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.card{background-color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.card{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.card:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.card:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.card:where(.dark,.dark *){background-color:#ffffff0b}@supports (color:color-mix(in lab, red, red)){.card:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 4.5%, transparent)}}.card:where(.dark,.dark *){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.input{border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-stone-300);background-color:var(--color-white);width:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);color:var(--color-stone-900);display:block}.input::placeholder{color:var(--color-stone-400)}.input:focus{border-color:var(--color-emerald-600);outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-emerald-600)}.input:disabled{cursor:not-allowed;opacity:.6}.input:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.input:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.input:where(.dark,.dark *){background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.input:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.input:where(.dark,.dark *){color:var(--color-stone-100)}.checkbox{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-color:var(--color-stone-300);accent-color:var(--color-emerald-600);border-radius:.25rem}.checkbox:where(.dark,.dark *){border-color:var(--color-stone-700)}.btn-primary{justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);background-color:var(--color-emerald-600);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-white);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-shadow-color:#004e3b33;display:inline-flex}@supports (color:color-mix(in lab, red, red)){.btn-primary{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-900) 20%, transparent) var(--tw-shadow-alpha), transparent)}}@media (hover:hover){.btn-primary:hover{background-color:var(--color-emerald-700)}}.btn-primary:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-emerald-600)}.btn-secondary{justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-stone-300);background-color:#fffc;display:inline-flex}@supports (color:color-mix(in lab, red, red)){.btn-secondary{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.btn-secondary{padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-stone-700)}@media (hover:hover){.btn-secondary:hover{background-color:var(--color-stone-50)}}.btn-secondary:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-emerald-600)}.btn-secondary:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.btn-secondary:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.btn-secondary:where(.dark,.dark *){background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.btn-secondary:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.btn-secondary:where(.dark,.dark *){color:var(--color-stone-200)}@media (hover:hover){.btn-secondary:where(.dark,.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.btn-secondary:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}}.btn-danger{justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-300);background-color:#fffc;display:inline-flex}@supports (color:color-mix(in lab, red, red)){.btn-danger{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.btn-danger{padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-red-700)}@media (hover:hover){.btn-danger:hover{background-color:var(--color-red-50)}}.btn-danger:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-red-600)}.btn-danger:where(.dark,.dark *){border-color:var(--color-red-900);background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.btn-danger:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.btn-danger:where(.dark,.dark *){color:var(--color-red-400)}@media (hover:hover){.btn-danger:where(.dark,.dark *):hover{background-color:var(--color-red-950)}}.modal{width:calc(100% - 2rem);max-width:var(--container-md);border-radius:var(--radius-2xl);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-stone-200);background-color:var(--color-white);color:var(--color-stone-900);--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);margin:auto;padding:0}.modal::backdrop{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.modal::backdrop{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.modal:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.modal:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.modal:where(.dark,.dark *){background-color:var(--color-stone-900);color:var(--color-stone-100)}.badge{padding-inline:calc(var(--spacing) * 2.5);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);border-radius:2147483647px;flex-shrink:0;align-items:center;display:inline-flex}.badge-red{background-color:var(--color-red-100);color:var(--color-red-800)}.badge-red:where(.dark,.dark *){background-color:var(--color-red-950);color:var(--color-red-300)}.badge-amber{background-color:var(--color-amber-100);color:var(--color-amber-800)}.badge-amber:where(.dark,.dark *){background-color:var(--color-amber-950);color:var(--color-amber-300)}.badge-green{background-color:var(--color-emerald-100);color:var(--color-emerald-800)}.badge-green:where(.dark,.dark *){background-color:var(--color-emerald-950);color:var(--color-emerald-300)}.badge-gray{background-color:var(--color-stone-100);color:var(--color-stone-700)}.badge-gray:where(.dark,.dark *){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.badge-gray:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.badge-gray:where(.dark,.dark *){color:var(--color-stone-300)}.stat-label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-stone-500)}.stat-label:where(.dark,.dark *){color:var(--color-stone-400)}.stat-value{margin-top:var(--spacing);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.tab{border-radius:var(--radius-lg);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-stone-600)}@media (hover:hover){.tab:hover{background-color:#dbe3de99}@supports (color:color-mix(in lab, red, red)){.tab:hover{background-color:color-mix(in oklab, var(--color-stone-200) 60%, transparent)}}}.tab:where(.dark,.dark *){color:var(--color-stone-300)}@media (hover:hover){.tab:where(.dark,.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.tab:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}}.tab-active{background-color:var(--color-emerald-600);color:var(--color-white)}@media (hover:hover){.tab-active:hover{background-color:var(--color-emerald-600)}}.tab-active:where(.dark,.dark *){background-color:var(--color-emerald-600);color:var(--color-white)}@media (hover:hover){.tab-active:where(.dark,.dark *):hover{background-color:var(--color-emerald-600)}}.track{height:calc(var(--spacing) * 2);background-color:#dbe3decc;border-radius:2147483647px;overflow:hidden}@supports (color:color-mix(in lab, red, red)){.track{background-color:color-mix(in oklab, var(--color-stone-200) 80%, transparent)}}.track:where(.dark,.dark *){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.track:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.heat-0{background-color:#dbe3deb3}@supports (color:color-mix(in lab, red, red)){.heat-0{background-color:color-mix(in oklab, var(--color-stone-200) 70%, transparent)}}.heat-0:where(.dark,.dark *){background-color:#ffffff0f}@supports (color:color-mix(in lab, red, red)){.heat-0:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 6%, transparent)}}.heat-1{background-color:var(--color-emerald-200)}.heat-1:where(.dark,.dark *){background-color:var(--color-emerald-900)}.heat-2{background-color:var(--color-emerald-300)}.heat-2:where(.dark,.dark *){background-color:var(--color-emerald-700)}.heat-3,.heat-3:where(.dark,.dark *){background-color:var(--color-emerald-500)}.heat-4{background-color:var(--color-emerald-600)}.heat-4:where(.dark,.dark *){background-color:var(--color-emerald-300)}}@layer utilities{.pointer-events-none{pointer-events:none}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1{top:var(--spacing)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:0}.right-1{right:var(--spacing)}.right-4{right:calc(var(--spacing) * 4)}.left-0{left:0}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:var(--spacing)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-24{width:calc(var(--spacing) * 24);height:calc(var(--spacing) * 24)}.size-32{width:calc(var(--spacing) * 32);height:calc(var(--spacing) * 32)}.size-full{width:100%;height:100%}.h-2{height:calc(var(--spacing) * 2)}.h-6{height:calc(var(--spacing) * 6)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-8{width:calc(var(--spacing) * 8)}.w-40{width:calc(var(--spacing) * 40)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-full{width:100%}.w-max{width:max-content}.max-w-2xl{max-width:var(--container-2xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[minmax\(0\,9rem\)_1fr_auto\]{grid-template-columns:minmax(0,9rem) 1fr auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-stone-100>:not(:last-child)){border-color:var(--color-stone-100)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\!border-amber-300{border-color:var(--color-amber-300)!important}.\!border-emerald-300{border-color:var(--color-emerald-300)!important}.\!border-red-300{border-color:var(--color-red-300)!important}.border-amber-300\/70{border-color:#ffd236b3}@supports (color:color-mix(in lab, red, red)){.border-amber-300\/70{border-color:color-mix(in oklab, var(--color-amber-300) 70%, transparent)}}.border-emerald-300\/70{border-color:#5ee9b5b3}@supports (color:color-mix(in lab, red, red)){.border-emerald-300\/70{border-color:color-mix(in oklab, var(--color-emerald-300) 70%, transparent)}}.border-sky-300\/70{border-color:#77d4ffb3}@supports (color:color-mix(in lab, red, red)){.border-sky-300\/70{border-color:color-mix(in oklab, var(--color-sky-300) 70%, transparent)}}.border-stone-100{border-color:var(--color-stone-100)}.border-stone-200{border-color:var(--color-stone-200)}.border-stone-200\/80{border-color:#dbe3decc}@supports (color:color-mix(in lab, red, red)){.border-stone-200\/80{border-color:color-mix(in oklab, var(--color-stone-200) 80%, transparent)}}.border-stone-300{border-color:var(--color-stone-300)}.\!bg-amber-50{background-color:var(--color-amber-50)!important}.\!bg-emerald-50{background-color:var(--color-emerald-50)!important}.\!bg-red-50{background-color:var(--color-red-50)!important}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-emerald-600\/15{background-color:#00976726}@supports (color:color-mix(in lab, red, red)){.bg-emerald-600\/15{background-color:color-mix(in oklab, var(--color-emerald-600) 15%, transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-sky-50{background-color:var(--color-sky-50)}.bg-stone-50\/80{background-color:#f6f9f7cc}@supports (color:color-mix(in lab, red, red)){.bg-stone-50\/80{background-color:color-mix(in oklab, var(--color-stone-50) 80%, transparent)}}.bg-stone-100{background-color:var(--color-stone-100)}.bg-white{background-color:var(--color-white)}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\/90{background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-emerald-500{--tw-gradient-from:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-400{--tw-gradient-to:var(--color-teal-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pr-1{padding-right:var(--spacing)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.\!text-amber-800{color:var(--color-amber-800)!important}.\!text-red-800{color:var(--color-red-800)!important}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-800\/80{color:#953d00cc}@supports (color:color-mix(in lab, red, red)){.text-amber-800\/80{color:color-mix(in oklab, var(--color-amber-800) 80%, transparent)}}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-emerald-800{color:var(--color-emerald-800)}.text-emerald-800\/80{color:#005f46cc}@supports (color:color-mix(in lab, red, red)){.text-emerald-800\/80{color:color-mix(in oklab, var(--color-emerald-800) 80%, transparent)}}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-sky-900{color:var(--color-sky-900)}.text-stone-400{color:var(--color-stone-400)}.text-stone-500{color:var(--color-stone-500)}.text-stone-600{color:var(--color-stone-600)}.text-stone-700{color:var(--color-stone-700)}.text-stone-900{color:var(--color-stone-900)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-stone-400::placeholder{color:var(--color-stone-400)}.opacity-30{opacity:.3}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-white{--tw-ring-color:var(--color-white)}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}:is(:where(.peer):checked~.peer-checked\:border-emerald-600){border-color:var(--color-emerald-600)}:is(:where(.peer):checked~.peer-checked\:bg-emerald-50){background-color:var(--color-emerald-50)}:is(:where(.peer):checked~.peer-checked\:text-emerald-800){color:var(--color-emerald-800)}:is(:where(.peer):focus-visible~.peer-focus-visible\:outline-2){outline-style:var(--tw-outline-style);outline-width:2px}:is(:where(.peer):focus-visible~.peer-focus-visible\:outline-offset-2){outline-offset:2px}:is(:where(.peer):focus-visible~.peer-focus-visible\:outline-emerald-600){outline-color:var(--color-emerald-600)}.first\:mt-4:first-child{margin-top:calc(var(--spacing) * 4)}.first\:pt-0:first-child{padding-top:0}@media (hover:hover){.hover\:border-emerald-600:hover{border-color:var(--color-emerald-600)}.hover\:bg-amber-100:hover{background-color:var(--color-amber-100)}.hover\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-stone-50:hover{background-color:var(--color-stone-50)}.hover\:bg-stone-50\/80:hover{background-color:#f6f9f7cc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-stone-50\/80:hover{background-color:color-mix(in oklab, var(--color-stone-50) 80%, transparent)}}.hover\:bg-stone-100:hover{background-color:var(--color-stone-100)}.hover\:bg-stone-200:hover{background-color:var(--color-stone-200)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-emerald-600:focus{border-color:var(--color-emerald-600)}.focus\:outline-2:focus{outline-style:var(--tw-outline-style);outline-width:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:outline-emerald-600:focus{outline-color:var(--color-emerald-600)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-red-600:focus-visible{outline-color:var(--color-red-600)}.data-open\:block[data-open]{display:block}.data-open\:translate-x-0[data-open]{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}@media (min-width:40rem){.sm\:table-cell{display:table-cell}.sm\:size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.sm\:size-28{width:calc(var(--spacing) * 28);height:calc(var(--spacing) * 28)}.sm\:h-7{height:calc(var(--spacing) * 7)}.sm\:w-80{width:calc(var(--spacing) * 80)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:max-w-xs{max-width:var(--container-xs)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,12rem\)_1fr_auto\]{grid-template-columns:minmax(0,12rem) 1fr auto}.sm\:flex-row{flex-direction:row}.sm\:items-end{align-items:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-8{padding-block:calc(var(--spacing) * 8)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.sm\:leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}}@media (min-width:48rem){.md\:table-cell{display:table-cell}}@media (min-width:64rem){.lg\:hidden{display:none}.lg\:table-cell{display:table-cell}.lg\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:pl-72{padding-left:calc(var(--spacing) * 72)}}.dark\:block:where(.dark,.dark *){display:block}.dark\:hidden:where(.dark,.dark *){display:none}:where(.dark\:divide-white\/5:where(.dark,.dark *)>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){:where(.dark\:divide-white\/5:where(.dark,.dark *)>:not(:last-child)){border-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:\!border-amber-500\/30:where(.dark,.dark *){border-color:#f99c004d!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!border-amber-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)!important}}.dark\:\!border-emerald-500\/30:where(.dark,.dark *){border-color:#00bb7f4d!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!border-emerald-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)!important}}.dark\:\!border-red-500\/30:where(.dark,.dark *){border-color:#fb2c364d!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!border-red-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)!important}}.dark\:border-amber-500\/30:where(.dark,.dark *){border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.dark\:border-amber-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.dark\:border-emerald-500\/30:where(.dark,.dark *){border-color:#00bb7f4d}@supports (color:color-mix(in lab, red, red)){.dark\:border-emerald-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)}}.dark\:border-sky-500\/30:where(.dark,.dark *){border-color:#00a5ef4d}@supports (color:color-mix(in lab, red, red)){.dark\:border-sky-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-sky-500) 30%, transparent)}}.dark\:border-stone-700:where(.dark,.dark *){border-color:var(--color-stone-700)}.dark\:border-white\/5:where(.dark,.dark *){border-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.dark\:border-white\/5:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:border-white\/10:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:border-white\/10:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\:\!bg-amber-500\/10:where(.dark,.dark *){background-color:#f99c001a!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!bg-amber-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)!important}}.dark\:\!bg-emerald-500\/10:where(.dark,.dark *){background-color:#00bb7f1a!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!bg-emerald-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)!important}}.dark\:\!bg-red-500\/10:where(.dark,.dark *){background-color:#fb2c361a!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!bg-red-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)!important}}.dark\:bg-amber-500\/10:where(.dark,.dark *){background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.dark\:bg-amber-950:where(.dark,.dark *){background-color:var(--color-amber-950)}.dark\:bg-black\/25:where(.dark,.dark *){background-color:#00000040}@supports (color:color-mix(in lab, red, red)){.dark\:bg-black\/25:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-black) 25%, transparent)}}.dark\:bg-emerald-400\/15:where(.dark,.dark *){background-color:#00d29426}@supports (color:color-mix(in lab, red, red)){.dark\:bg-emerald-400\/15:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-emerald-400) 15%, transparent)}}.dark\:bg-emerald-500\/10:where(.dark,.dark *){background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-emerald-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.dark\:bg-emerald-950:where(.dark,.dark *){background-color:var(--color-emerald-950)}.dark\:bg-red-950:where(.dark,.dark *){background-color:var(--color-red-950)}.dark\:bg-sky-500\/10:where(.dark,.dark *){background-color:#00a5ef1a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-sky-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-sky-500) 10%, transparent)}}.dark\:bg-stone-800:where(.dark,.dark *){background-color:var(--color-stone-800)}.dark\:bg-stone-900:where(.dark,.dark *){background-color:var(--color-stone-900)}.dark\:bg-stone-900\/75:where(.dark,.dark *){background-color:#17201bbf}@supports (color:color-mix(in lab, red, red)){.dark\:bg-stone-900\/75:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-stone-900) 75%, transparent)}}.dark\:\!text-amber-300:where(.dark,.dark *){color:var(--color-amber-300)!important}.dark\:\!text-red-300:where(.dark,.dark *){color:var(--color-red-300)!important}.dark\:text-amber-200:where(.dark,.dark *){color:var(--color-amber-200)}.dark\:text-amber-300:where(.dark,.dark *){color:var(--color-amber-300)}.dark\:text-amber-300\/80:where(.dark,.dark *){color:#ffd236cc}@supports (color:color-mix(in lab, red, red)){.dark\:text-amber-300\/80:where(.dark,.dark *){color:color-mix(in oklab, var(--color-amber-300) 80%, transparent)}}.dark\:text-amber-400:where(.dark,.dark *){color:var(--color-amber-400)}.dark\:text-emerald-300:where(.dark,.dark *){color:var(--color-emerald-300)}.dark\:text-emerald-300\/80:where(.dark,.dark *){color:#5ee9b5cc}@supports (color:color-mix(in lab, red, red)){.dark\:text-emerald-300\/80:where(.dark,.dark *){color:color-mix(in oklab, var(--color-emerald-300) 80%, transparent)}}.dark\:text-emerald-400:where(.dark,.dark *){color:var(--color-emerald-400)}.dark\:text-red-200:where(.dark,.dark *){color:var(--color-red-200)}.dark\:text-red-300:where(.dark,.dark *){color:var(--color-red-300)}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400)}.dark\:text-sky-200:where(.dark,.dark *){color:var(--color-sky-200)}.dark\:text-stone-100:where(.dark,.dark *){color:var(--color-stone-100)}.dark\:text-stone-200:where(.dark,.dark *){color:var(--color-stone-200)}.dark\:text-stone-300:where(.dark,.dark *){color:var(--color-stone-300)}.dark\:text-stone-400:where(.dark,.dark *){color:var(--color-stone-400)}.dark\:text-stone-500:where(.dark,.dark *){color:var(--color-stone-500)}.dark\:ring-stone-900:where(.dark,.dark *){--tw-ring-color:var(--color-stone-900)}:is(:where(.peer):checked~.dark\:peer-checked\:border-emerald-500:where(.dark,.dark *)){border-color:var(--color-emerald-500)}:is(:where(.peer):checked~.dark\:peer-checked\:bg-emerald-950:where(.dark,.dark *)){background-color:var(--color-emerald-950)}:is(:where(.peer):checked~.dark\:peer-checked\:text-emerald-300:where(.dark,.dark *)){color:var(--color-emerald-300)}@media (hover:hover){.dark\:hover\:bg-amber-500\/15:where(.dark,.dark *):hover{background-color:#f99c0026}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-amber-500\/15:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-amber-500) 15%, transparent)}}.dark\:hover\:bg-stone-800:where(.dark,.dark *):hover{background-color:var(--color-stone-800)}.dark\:hover\:bg-stone-800\/50:where(.dark,.dark *):hover{background-color:#26312b80}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-stone-800\/50:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-stone-800) 50%, transparent)}}.dark\:hover\:bg-white\/5:where(.dark,.dark *):hover{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-white\/5:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:hover\:bg-white\/10:where(.dark,.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-white\/10:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}}@media print{.print\:hidden{display:none}.print\:inline{display:inline}.print\:table-cell{display:table-cell}.print\:p-0{padding:0}}.\[\&_ul\]\:list-disc ul{list-style-type:disc}.\[\&_ul\]\:pl-4 ul{padding-left:calc(var(--spacing) * 4)}}.app-bg{background-color:var(--color-stone-100);background-image:radial-gradient(60rem 34rem at 0 -8%,#10b98124,#0000 62%),radial-gradient(46rem 28rem at 100% 0,#14b8a61a,#0000 60%);background-attachment:fixed}.dark .app-bg{background-color:var(--color-stone-950);background-image:radial-gradient(62rem 36rem at 0 -8%,#10b9812b,#0000 62%),radial-gradient(46rem 30rem at 100% 100%,#2dd4bf17,#0000 58%)}html[data-readonly] form[method=post]:not([data-allow]),html[data-readonly] [data-write]{display:none!important}.ring{--ring-width:11px;background:conic-gradient(var(--ring-color,#10b981) calc(var(--pct,0) * 1%), #788c8233 0);-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - var(--ring-width)), #000 calc(100% - var(--ring-width) + 1px));-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - var(--ring-width)), #000 calc(100% - var(--ring-width) + 1px));mask:radial-gradient(farthest-side, transparent calc(100% - var(--ring-width)), #000 calc(100% - var(--ring-width) + 1px));border-radius:9999px}@media print{.app-bg,.dark .app-bg{background:#fff!important}.card{box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;background:#fff!important;border-color:#cbd5d0!important}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid} \ No newline at end of file +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-emerald-950:oklch(26.2% .051 172.552);--color-teal-400:oklch(77.7% .152 181.912);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-200:oklch(90.1% .058 230.902);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-900:oklch(39.1% .09 240.876);--color-stone-50:#f6f9f7;--color-stone-100:#ecf1ee;--color-stone-200:#dbe3de;--color-stone-300:#bcc9c1;--color-stone-400:#8c9d93;--color-stone-500:#5a6a60;--color-stone-600:#4f5f55;--color-stone-700:#3a473f;--color-stone-800:#26312b;--color-stone-900:#17201b;--color-stone-950:#0b110e;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{scroll-padding-top:6rem}:focus-visible{outline:2px solid var(--color-emerald-600);outline-offset:2px}.dark :focus-visible{outline-color:var(--color-emerald-400)}}@layer components{.card{border-radius:var(--radius-2xl);border-style:var(--tw-border-style);border-width:1px;border-color:#dbe3decc}@supports (color:color-mix(in lab, red, red)){.card{border-color:color-mix(in oklab, var(--color-stone-200) 80%, transparent)}}.card{background-color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.card{background-color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.card{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.card:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.card:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.card:where(.dark,.dark *){background-color:#ffffff0b}@supports (color:color-mix(in lab, red, red)){.card:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 4.5%, transparent)}}.card:where(.dark,.dark *){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.input{min-height:calc(var(--spacing) * 11);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-stone-300);background-color:var(--color-white);width:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);color:var(--color-stone-900);display:block}.input::placeholder{color:var(--color-stone-500)}.input:focus{border-color:var(--color-emerald-600);outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-emerald-600)}.input:disabled{cursor:not-allowed;opacity:.6}@media (min-width:40rem){.input{min-height:0}}.input:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.input:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.input:where(.dark,.dark *){background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.input:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.input:where(.dark,.dark *){color:var(--color-stone-100)}.skip-link{top:calc(var(--spacing) * 3);left:calc(var(--spacing) * 3);z-index:50;--tw-translate-y:calc(var(--spacing) * -24);translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:var(--radius-lg);background-color:var(--color-emerald-700);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-white);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);position:fixed}.skip-link:focus{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.checkbox{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-color:var(--color-stone-300);accent-color:var(--color-emerald-600);border-radius:.25rem}.checkbox:where(.dark,.dark *){border-color:var(--color-stone-700)}.btn-primary{min-height:calc(var(--spacing) * 11);justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);background-color:var(--color-emerald-700);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-white);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-shadow-color:#004e3b33;display:inline-flex}@supports (color:color-mix(in lab, red, red)){.btn-primary{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-900) 20%, transparent) var(--tw-shadow-alpha), transparent)}}@media (hover:hover){.btn-primary:hover{background-color:var(--color-emerald-800)}}.btn-primary:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-emerald-600)}@media (min-width:40rem){.btn-primary{min-height:0}}.btn-secondary{min-height:calc(var(--spacing) * 11);justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-stone-300);background-color:#fffc;display:inline-flex}@supports (color:color-mix(in lab, red, red)){.btn-secondary{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.btn-secondary{padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-stone-700)}@media (hover:hover){.btn-secondary:hover{background-color:var(--color-stone-50)}}.btn-secondary:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-emerald-600)}@media (min-width:40rem){.btn-secondary{min-height:0}}.btn-secondary:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.btn-secondary:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.btn-secondary:where(.dark,.dark *){background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.btn-secondary:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.btn-secondary:where(.dark,.dark *){color:var(--color-stone-200)}@media (hover:hover){.btn-secondary:where(.dark,.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.btn-secondary:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}}.btn-danger{min-height:calc(var(--spacing) * 11);justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-300);background-color:#fffc;display:inline-flex}@supports (color:color-mix(in lab, red, red)){.btn-danger{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.btn-danger{padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-red-700)}@media (hover:hover){.btn-danger:hover{background-color:var(--color-red-50)}}.btn-danger:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-red-600)}@media (min-width:40rem){.btn-danger{min-height:0}}.btn-danger:where(.dark,.dark *){border-color:var(--color-red-900);background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.btn-danger:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.btn-danger:where(.dark,.dark *){color:var(--color-red-400)}@media (hover:hover){.btn-danger:where(.dark,.dark *):hover{background-color:var(--color-red-950)}}.modal{width:calc(100% - 2rem);max-width:var(--container-md);border-radius:var(--radius-2xl);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-stone-200);background-color:var(--color-white);color:var(--color-stone-900);--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);margin:auto;padding:0}.modal::backdrop{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.modal::backdrop{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.modal:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.modal:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.modal:where(.dark,.dark *){background-color:var(--color-stone-900);color:var(--color-stone-100)}.badge{padding-inline:calc(var(--spacing) * 2.5);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);border-radius:2147483647px;flex-shrink:0;align-items:center;display:inline-flex}.badge-red{background-color:var(--color-red-100);color:var(--color-red-800)}.badge-red:where(.dark,.dark *){background-color:var(--color-red-950);color:var(--color-red-300)}.badge-amber{background-color:var(--color-amber-100);color:var(--color-amber-800)}.badge-amber:where(.dark,.dark *){background-color:var(--color-amber-950);color:var(--color-amber-300)}.badge-green{background-color:var(--color-emerald-100);color:var(--color-emerald-800)}.badge-green:where(.dark,.dark *){background-color:var(--color-emerald-950);color:var(--color-emerald-300)}.badge-gray{background-color:var(--color-stone-100);color:var(--color-stone-700)}.badge-gray:where(.dark,.dark *){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.badge-gray:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.badge-gray:where(.dark,.dark *){color:var(--color-stone-300)}.stat-label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-stone-500)}.stat-label:where(.dark,.dark *){color:var(--color-stone-400)}.stat-value{margin-top:var(--spacing);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.tab{min-height:calc(var(--spacing) * 11);border-radius:var(--radius-lg);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-stone-600);align-items:center;display:inline-flex}@media (hover:hover){.tab:hover{background-color:#dbe3de99}@supports (color:color-mix(in lab, red, red)){.tab:hover{background-color:color-mix(in oklab, var(--color-stone-200) 60%, transparent)}}}@media (min-width:40rem){.tab{min-height:0}}.tab:where(.dark,.dark *){color:var(--color-stone-300)}@media (hover:hover){.tab:where(.dark,.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.tab:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}}.tab-active{background-color:var(--color-emerald-700);color:var(--color-white)}@media (hover:hover){.tab-active:hover{background-color:var(--color-emerald-700)}}.tab-active:where(.dark,.dark *){background-color:var(--color-emerald-700);color:var(--color-white)}@media (hover:hover){.tab-active:where(.dark,.dark *):hover{background-color:var(--color-emerald-700)}}.track{height:calc(var(--spacing) * 2);background-color:#dbe3decc;border-radius:2147483647px;overflow:hidden}@supports (color:color-mix(in lab, red, red)){.track{background-color:color-mix(in oklab, var(--color-stone-200) 80%, transparent)}}.track:where(.dark,.dark *){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.track:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.heat-0{background-color:#dbe3deb3}@supports (color:color-mix(in lab, red, red)){.heat-0{background-color:color-mix(in oklab, var(--color-stone-200) 70%, transparent)}}.heat-0:where(.dark,.dark *){background-color:#ffffff0f}@supports (color:color-mix(in lab, red, red)){.heat-0:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-white) 6%, transparent)}}.heat-1{background-color:var(--color-emerald-200)}.heat-1:where(.dark,.dark *){background-color:var(--color-emerald-900)}.heat-2{background-color:var(--color-emerald-300)}.heat-2:where(.dark,.dark *){background-color:var(--color-emerald-700)}.heat-3,.heat-3:where(.dark,.dark *){background-color:var(--color-emerald-500)}.heat-4{background-color:var(--color-emerald-600)}.heat-4:where(.dark,.dark *){background-color:var(--color-emerald-300)}}@layer utilities{.pointer-events-none{pointer-events:none}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1{top:var(--spacing)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:0}.right-1{right:var(--spacing)}.right-4{right:calc(var(--spacing) * 4)}.left-0{left:0}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:var(--spacing)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-24{width:calc(var(--spacing) * 24);height:calc(var(--spacing) * 24)}.size-32{width:calc(var(--spacing) * 32);height:calc(var(--spacing) * 32)}.size-full{width:100%;height:100%}.h-2{height:calc(var(--spacing) * 2)}.h-6{height:calc(var(--spacing) * 6)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-40{width:calc(var(--spacing) * 40)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-full{width:100%}.w-max{width:max-content}.max-w-2xl{max-width:var(--container-2xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[minmax\(0\,9rem\)_1fr_auto\]{grid-template-columns:minmax(0,9rem) 1fr auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-stone-100>:not(:last-child)){border-color:var(--color-stone-100)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\!border-amber-300{border-color:var(--color-amber-300)!important}.\!border-emerald-300{border-color:var(--color-emerald-300)!important}.\!border-red-300{border-color:var(--color-red-300)!important}.border-amber-300\/70{border-color:#ffd236b3}@supports (color:color-mix(in lab, red, red)){.border-amber-300\/70{border-color:color-mix(in oklab, var(--color-amber-300) 70%, transparent)}}.border-emerald-300\/70{border-color:#5ee9b5b3}@supports (color:color-mix(in lab, red, red)){.border-emerald-300\/70{border-color:color-mix(in oklab, var(--color-emerald-300) 70%, transparent)}}.border-red-300{border-color:var(--color-red-300)}.border-sky-300\/70{border-color:#77d4ffb3}@supports (color:color-mix(in lab, red, red)){.border-sky-300\/70{border-color:color-mix(in oklab, var(--color-sky-300) 70%, transparent)}}.border-stone-100{border-color:var(--color-stone-100)}.border-stone-200{border-color:var(--color-stone-200)}.border-stone-200\/80{border-color:#dbe3decc}@supports (color:color-mix(in lab, red, red)){.border-stone-200\/80{border-color:color-mix(in oklab, var(--color-stone-200) 80%, transparent)}}.border-stone-300{border-color:var(--color-stone-300)}.\!bg-amber-50{background-color:var(--color-amber-50)!important}.\!bg-emerald-50{background-color:var(--color-emerald-50)!important}.\!bg-red-50{background-color:var(--color-red-50)!important}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-emerald-600\/15{background-color:#00976726}@supports (color:color-mix(in lab, red, red)){.bg-emerald-600\/15{background-color:color-mix(in oklab, var(--color-emerald-600) 15%, transparent)}}.bg-emerald-700{background-color:var(--color-emerald-700)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-sky-50{background-color:var(--color-sky-50)}.bg-stone-50\/80{background-color:#f6f9f7cc}@supports (color:color-mix(in lab, red, red)){.bg-stone-50\/80{background-color:color-mix(in oklab, var(--color-stone-50) 80%, transparent)}}.bg-stone-100{background-color:var(--color-stone-100)}.bg-white{background-color:var(--color-white)}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\/90{background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-emerald-500{--tw-gradient-from:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-400{--tw-gradient-to:var(--color-teal-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pr-1{padding-right:var(--spacing)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.\!text-amber-800{color:var(--color-amber-800)!important}.\!text-red-800{color:var(--color-red-800)!important}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-800\/80{color:#953d00cc}@supports (color:color-mix(in lab, red, red)){.text-amber-800\/80{color:color-mix(in oklab, var(--color-amber-800) 80%, transparent)}}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-emerald-800{color:var(--color-emerald-800)}.text-emerald-800\/80{color:#005f46cc}@supports (color:color-mix(in lab, red, red)){.text-emerald-800\/80{color:color-mix(in oklab, var(--color-emerald-800) 80%, transparent)}}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-sky-900{color:var(--color-sky-900)}.text-stone-500{color:var(--color-stone-500)}.text-stone-600{color:var(--color-stone-600)}.text-stone-700{color:var(--color-stone-700)}.text-stone-900{color:var(--color-stone-900)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-stone-500::placeholder{color:var(--color-stone-500)}.opacity-30{opacity:.3}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-white{--tw-ring-color:var(--color-white)}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}:is(:where(.peer):checked~.peer-checked\:border-emerald-600){border-color:var(--color-emerald-600)}:is(:where(.peer):checked~.peer-checked\:bg-emerald-50){background-color:var(--color-emerald-50)}:is(:where(.peer):checked~.peer-checked\:text-emerald-800){color:var(--color-emerald-800)}:is(:where(.peer):focus-visible~.peer-focus-visible\:outline-2){outline-style:var(--tw-outline-style);outline-width:2px}:is(:where(.peer):focus-visible~.peer-focus-visible\:outline-offset-2){outline-offset:2px}:is(:where(.peer):focus-visible~.peer-focus-visible\:outline-emerald-600){outline-color:var(--color-emerald-600)}.first\:mt-4:first-child{margin-top:calc(var(--spacing) * 4)}.first\:pt-0:first-child{padding-top:0}@media (hover:hover){.hover\:border-emerald-600:hover{border-color:var(--color-emerald-600)}.hover\:bg-amber-100:hover{background-color:var(--color-amber-100)}.hover\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.hover\:bg-emerald-800:hover{background-color:var(--color-emerald-800)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-stone-50:hover{background-color:var(--color-stone-50)}.hover\:bg-stone-50\/80:hover{background-color:#f6f9f7cc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-stone-50\/80:hover{background-color:color-mix(in oklab, var(--color-stone-50) 80%, transparent)}}.hover\:bg-stone-100:hover{background-color:var(--color-stone-100)}.hover\:bg-stone-200:hover{background-color:var(--color-stone-200)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-emerald-600:focus{border-color:var(--color-emerald-600)}.focus\:outline-2:focus{outline-style:var(--tw-outline-style);outline-width:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:outline-emerald-600:focus{outline-color:var(--color-emerald-600)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-red-600:focus-visible{outline-color:var(--color-red-600)}.data-open\:block[data-open]{display:block}.data-open\:translate-x-0[data-open]{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}@media (min-width:40rem){.sm\:table-cell{display:table-cell}.sm\:size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.sm\:size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.sm\:size-28{width:calc(var(--spacing) * 28);height:calc(var(--spacing) * 28)}.sm\:h-7{height:calc(var(--spacing) * 7)}.sm\:w-80{width:calc(var(--spacing) * 80)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:max-w-xs{max-width:var(--container-xs)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,12rem\)_1fr_auto\]{grid-template-columns:minmax(0,12rem) 1fr auto}.sm\:flex-row{flex-direction:row}.sm\:items-end{align-items:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-8{padding-block:calc(var(--spacing) * 8)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.sm\:leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}}@media (min-width:48rem){.md\:table-cell{display:table-cell}}@media (min-width:64rem){.lg\:hidden{display:none}.lg\:table-cell{display:table-cell}.lg\:size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.lg\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:py-2{padding-block:calc(var(--spacing) * 2)}.lg\:pl-72{padding-left:calc(var(--spacing) * 72)}}.dark\:block:where(.dark,.dark *){display:block}.dark\:hidden:where(.dark,.dark *){display:none}:where(.dark\:divide-white\/5:where(.dark,.dark *)>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){:where(.dark\:divide-white\/5:where(.dark,.dark *)>:not(:last-child)){border-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:\!border-amber-500\/30:where(.dark,.dark *){border-color:#f99c004d!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!border-amber-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)!important}}.dark\:\!border-emerald-500\/30:where(.dark,.dark *){border-color:#00bb7f4d!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!border-emerald-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)!important}}.dark\:\!border-red-500\/30:where(.dark,.dark *){border-color:#fb2c364d!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!border-red-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)!important}}.dark\:border-amber-500\/30:where(.dark,.dark *){border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.dark\:border-amber-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.dark\:border-emerald-500\/30:where(.dark,.dark *){border-color:#00bb7f4d}@supports (color:color-mix(in lab, red, red)){.dark\:border-emerald-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)}}.dark\:border-red-500\/30:where(.dark,.dark *){border-color:#fb2c364d}@supports (color:color-mix(in lab, red, red)){.dark\:border-red-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)}}.dark\:border-sky-500\/30:where(.dark,.dark *){border-color:#00a5ef4d}@supports (color:color-mix(in lab, red, red)){.dark\:border-sky-500\/30:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-sky-500) 30%, transparent)}}.dark\:border-stone-700:where(.dark,.dark *){border-color:var(--color-stone-700)}.dark\:border-white\/5:where(.dark,.dark *){border-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.dark\:border-white\/5:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:border-white\/10:where(.dark,.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:border-white\/10:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\:\!bg-amber-500\/10:where(.dark,.dark *){background-color:#f99c001a!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!bg-amber-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)!important}}.dark\:\!bg-emerald-500\/10:where(.dark,.dark *){background-color:#00bb7f1a!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!bg-emerald-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)!important}}.dark\:\!bg-red-500\/10:where(.dark,.dark *){background-color:#fb2c361a!important}@supports (color:color-mix(in lab, red, red)){.dark\:\!bg-red-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)!important}}.dark\:bg-amber-500\/10:where(.dark,.dark *){background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.dark\:bg-amber-950:where(.dark,.dark *){background-color:var(--color-amber-950)}.dark\:bg-black\/25:where(.dark,.dark *){background-color:#00000040}@supports (color:color-mix(in lab, red, red)){.dark\:bg-black\/25:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-black) 25%, transparent)}}.dark\:bg-emerald-400\/15:where(.dark,.dark *){background-color:#00d29426}@supports (color:color-mix(in lab, red, red)){.dark\:bg-emerald-400\/15:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-emerald-400) 15%, transparent)}}.dark\:bg-emerald-500\/10:where(.dark,.dark *){background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-emerald-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.dark\:bg-emerald-950:where(.dark,.dark *){background-color:var(--color-emerald-950)}.dark\:bg-red-950:where(.dark,.dark *){background-color:var(--color-red-950)}.dark\:bg-sky-500\/10:where(.dark,.dark *){background-color:#00a5ef1a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-sky-500\/10:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-sky-500) 10%, transparent)}}.dark\:bg-stone-800:where(.dark,.dark *){background-color:var(--color-stone-800)}.dark\:bg-stone-900:where(.dark,.dark *){background-color:var(--color-stone-900)}.dark\:bg-stone-900\/75:where(.dark,.dark *){background-color:#17201bbf}@supports (color:color-mix(in lab, red, red)){.dark\:bg-stone-900\/75:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-stone-900) 75%, transparent)}}.dark\:\!text-amber-300:where(.dark,.dark *){color:var(--color-amber-300)!important}.dark\:\!text-red-300:where(.dark,.dark *){color:var(--color-red-300)!important}.dark\:text-amber-200:where(.dark,.dark *){color:var(--color-amber-200)}.dark\:text-amber-300:where(.dark,.dark *){color:var(--color-amber-300)}.dark\:text-amber-300\/80:where(.dark,.dark *){color:#ffd236cc}@supports (color:color-mix(in lab, red, red)){.dark\:text-amber-300\/80:where(.dark,.dark *){color:color-mix(in oklab, var(--color-amber-300) 80%, transparent)}}.dark\:text-amber-400:where(.dark,.dark *){color:var(--color-amber-400)}.dark\:text-emerald-300:where(.dark,.dark *){color:var(--color-emerald-300)}.dark\:text-emerald-300\/80:where(.dark,.dark *){color:#5ee9b5cc}@supports (color:color-mix(in lab, red, red)){.dark\:text-emerald-300\/80:where(.dark,.dark *){color:color-mix(in oklab, var(--color-emerald-300) 80%, transparent)}}.dark\:text-emerald-400:where(.dark,.dark *){color:var(--color-emerald-400)}.dark\:text-red-200:where(.dark,.dark *){color:var(--color-red-200)}.dark\:text-red-300:where(.dark,.dark *){color:var(--color-red-300)}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400)}.dark\:text-sky-200:where(.dark,.dark *){color:var(--color-sky-200)}.dark\:text-stone-100:where(.dark,.dark *){color:var(--color-stone-100)}.dark\:text-stone-200:where(.dark,.dark *){color:var(--color-stone-200)}.dark\:text-stone-300:where(.dark,.dark *){color:var(--color-stone-300)}.dark\:text-stone-400:where(.dark,.dark *){color:var(--color-stone-400)}.dark\:ring-stone-900:where(.dark,.dark *){--tw-ring-color:var(--color-stone-900)}:is(:where(.peer):checked~.dark\:peer-checked\:border-emerald-500:where(.dark,.dark *)){border-color:var(--color-emerald-500)}:is(:where(.peer):checked~.dark\:peer-checked\:bg-emerald-950:where(.dark,.dark *)){background-color:var(--color-emerald-950)}:is(:where(.peer):checked~.dark\:peer-checked\:text-emerald-300:where(.dark,.dark *)){color:var(--color-emerald-300)}@media (hover:hover){.dark\:hover\:bg-amber-500\/15:where(.dark,.dark *):hover{background-color:#f99c0026}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-amber-500\/15:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-amber-500) 15%, transparent)}}.dark\:hover\:bg-stone-800:where(.dark,.dark *):hover{background-color:var(--color-stone-800)}.dark\:hover\:bg-stone-800\/50:where(.dark,.dark *):hover{background-color:#26312b80}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-stone-800\/50:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-stone-800) 50%, transparent)}}.dark\:hover\:bg-white\/5:where(.dark,.dark *):hover{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-white\/5:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:hover\:bg-white\/10:where(.dark,.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-white\/10:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}}.\[\&_ul\]\:list-disc ul{list-style-type:disc}.\[\&_ul\]\:pl-4 ul{padding-left:calc(var(--spacing) * 4)}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}.app-bg{background-color:var(--color-stone-100);background-image:radial-gradient(60rem 34rem at 0 -8%,#10b98124,#0000 62%),radial-gradient(46rem 28rem at 100% 0,#14b8a61a,#0000 60%);background-attachment:fixed}.dark .app-bg{background-color:var(--color-stone-950);background-image:radial-gradient(62rem 36rem at 0 -8%,#10b9812b,#0000 62%),radial-gradient(46rem 30rem at 100% 100%,#2dd4bf17,#0000 58%)}html[data-readonly] form[method=post]:not([data-allow]),html[data-readonly] [data-write]{display:none!important}.ring{--ring-width:11px;background:conic-gradient(var(--ring-color,#10b981) calc(var(--pct,0) * 1%), #788c8233 0);-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - var(--ring-width)), #000 calc(100% - var(--ring-width) + 1px));-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - var(--ring-width)), #000 calc(100% - var(--ring-width) + 1px));mask:radial-gradient(farthest-side, transparent calc(100% - var(--ring-width)), #000 calc(100% - var(--ring-width) + 1px));border-radius:9999px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid} \ No newline at end of file diff --git a/static/js/app.js b/static/js/app.js index 593fe63..527712a 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -38,9 +38,28 @@ document.addEventListener('change', (event) => { }); // Sidebar (mobile drawer): the menu button opens it, the overlay, Esc or a link closes it. +// Closed on a small screen it is inert, so Tab never lands on links nobody can see. +const wideScreen = matchMedia('(min-width: 1024px)'); + +function syncSidebar() { + const sidebar = document.getElementById('sidebar'); + if (!sidebar) return; + const open = sidebar.hasAttribute('data-open'); + sidebar.toggleAttribute('inert', !wideScreen.matches && !open); + document + .querySelector('[data-sidebar-toggle]') + ?.setAttribute('aria-expanded', String(open)); +} + function setSidebar(open) { - document.getElementById('sidebar')?.toggleAttribute('data-open', open); + const sidebar = document.getElementById('sidebar'); + if (!sidebar) return; + const wasOpen = sidebar.hasAttribute('data-open'); + sidebar.toggleAttribute('data-open', open); document.getElementById('sidebar-overlay')?.toggleAttribute('data-open', open); + syncSidebar(); + if (open) sidebar.querySelector('a, button')?.focus(); + else if (wasOpen) document.querySelector('[data-sidebar-toggle]')?.focus(); } document.addEventListener('click', (event) => { if (event.target.closest('[data-sidebar-toggle]')) setSidebar(true); @@ -50,6 +69,28 @@ document.addEventListener('click', (event) => { document.addEventListener('keydown', (event) => { if (event.key === 'Escape') setSidebar(false); }); +wideScreen.addEventListener('change', syncSidebar); +document.addEventListener('DOMContentLoaded', syncSidebar); + +// A form that was sent cannot be sent again while the page loads: no double entries. +document.addEventListener('submit', (event) => { + const form = event.target; + if (event.defaultPrevented || form.method !== 'post') return; + if (form.hasAttribute('hx-post')) return; + requestAnimationFrame(() => { + form.querySelectorAll('button[type="submit"]').forEach((button) => { + button.disabled = true; + button.setAttribute('aria-busy', 'true'); + }); + }); +}); +window.addEventListener('pageshow', (event) => { + if (!event.persisted) return; + document.querySelectorAll('button[aria-busy="true"]').forEach((button) => { + button.disabled = false; + button.removeAttribute('aria-busy'); + }); +}); // Dropdown menus built on
close when you click elsewhere. document.addEventListener('click', (event) => { @@ -57,16 +98,3 @@ document.addEventListener('click', (event) => { if (!menu.contains(event.target)) menu.removeAttribute('open'); }); }); - -// Print buttons; paper is always printed with the light theme. -document.addEventListener('click', (event) => { - if (event.target.closest('[data-print]')) window.print(); -}); -let darkBeforePrint = false; -window.addEventListener('beforeprint', () => { - darkBeforePrint = document.documentElement.classList.contains('dark'); - document.documentElement.classList.remove('dark'); -}); -window.addEventListener('afterprint', () => { - if (darkBeforePrint) document.documentElement.classList.add('dark'); -}); diff --git a/tailwind/input.css b/tailwind/input.css index 8914a8d..3e410f5 100644 --- a/tailwind/input.css +++ b/tailwind/input.css @@ -1,4 +1,7 @@ -@import 'tailwindcss'; +/* No automatic source detection: only the templates and the Python code are + scanned, so the built CSS is the same on every machine and in CI, whatever + other files (notes, local tools) happen to be in the folder. */ +@import 'tailwindcss' source(none); @source '../templates'; @source '../apps'; @@ -13,7 +16,7 @@ --color-stone-200: #dbe3de; --color-stone-300: #bcc9c1; --color-stone-400: #8c9d93; - --color-stone-500: #66786d; + --color-stone-500: #5a6a60; --color-stone-600: #4f5f55; --color-stone-700: #3a473f; --color-stone-800: #26312b; @@ -21,6 +24,31 @@ --color-stone-950: #0b110e; } +@layer base { + html { + /* Keep the focused control clear of the sticky top bar. */ + scroll-padding-top: 6rem; + } + :focus-visible { + outline: 2px solid var(--color-emerald-600); + outline-offset: 2px; + } + .dark :focus-visible { + outline-color: var(--color-emerald-400); + } +} + +@media (prefers-reduced-motion: reduce) { + *, + ::before, + ::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + scroll-behavior: auto !important; + } +} + .app-bg { background-color: var(--color-stone-100); background-image: @@ -56,37 +84,27 @@ html[data-readonly] [data-write] { ); } -@media print { - .app-bg, - .dark .app-bg { - background: #fff !important; - } - .card { - background: #fff !important; - border-color: #cbd5d0 !important; - box-shadow: none !important; - backdrop-filter: none !important; - } -} - @layer components { .card { @apply rounded-2xl border border-stone-200/80 bg-white/85 shadow-sm backdrop-blur-sm dark:border-white/10 dark:bg-white/[0.045] dark:shadow-none; } .input { - @apply block w-full rounded-lg border border-stone-300 bg-white px-3 py-2 text-stone-900 placeholder-stone-400 focus:border-emerald-600 focus:outline-2 focus:outline-emerald-600 disabled:cursor-not-allowed disabled:opacity-60 dark:border-white/10 dark:bg-black/30 dark:text-stone-100; + @apply block min-h-11 w-full rounded-lg border border-stone-300 sm:min-h-0 bg-white px-3 py-2 text-stone-900 placeholder-stone-500 focus:border-emerald-600 focus:outline-2 focus:outline-emerald-600 disabled:cursor-not-allowed disabled:opacity-60 dark:border-white/10 dark:bg-black/30 dark:text-stone-100; + } + .skip-link { + @apply fixed left-3 top-3 z-50 -translate-y-24 rounded-lg bg-emerald-700 px-4 py-2.5 text-sm font-medium text-white shadow-lg focus:translate-y-0; } .checkbox { @apply size-4 rounded border-stone-300 accent-emerald-600 dark:border-stone-700; } .btn-primary { - @apply inline-flex items-center justify-center gap-1.5 rounded-lg bg-emerald-600 px-3.5 py-2 text-sm font-medium text-white shadow-sm shadow-emerald-900/20 hover:bg-emerald-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-600; + @apply inline-flex min-h-11 sm:min-h-0 items-center justify-center gap-1.5 rounded-lg bg-emerald-700 px-3.5 py-2 text-sm font-medium text-white shadow-sm shadow-emerald-900/20 hover:bg-emerald-800 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-600; } .btn-secondary { - @apply inline-flex items-center justify-center gap-1.5 rounded-lg border border-stone-300 bg-white/80 px-3.5 py-2 text-sm font-medium text-stone-700 hover:bg-stone-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-600 dark:border-white/10 dark:bg-white/5 dark:text-stone-200 dark:hover:bg-white/10; + @apply inline-flex min-h-11 sm:min-h-0 items-center justify-center gap-1.5 rounded-lg border border-stone-300 bg-white/80 px-3.5 py-2 text-sm font-medium text-stone-700 hover:bg-stone-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-600 dark:border-white/10 dark:bg-white/5 dark:text-stone-200 dark:hover:bg-white/10; } .btn-danger { - @apply inline-flex items-center justify-center gap-1.5 rounded-lg border border-red-300 bg-white/80 px-3.5 py-2 text-sm font-medium text-red-700 hover:bg-red-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600 dark:border-red-900 dark:bg-white/5 dark:text-red-400 dark:hover:bg-red-950; + @apply inline-flex min-h-11 sm:min-h-0 items-center justify-center gap-1.5 rounded-lg border border-red-300 bg-white/80 px-3.5 py-2 text-sm font-medium text-red-700 hover:bg-red-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600 dark:border-red-900 dark:bg-white/5 dark:text-red-400 dark:hover:bg-red-950; } .modal { @apply m-auto w-[calc(100%-2rem)] max-w-md rounded-2xl border border-stone-200 bg-white p-0 text-stone-900 shadow-xl backdrop:bg-black/50 dark:border-white/10 dark:bg-stone-900 dark:text-stone-100; @@ -113,10 +131,10 @@ html[data-readonly] [data-write] { @apply mt-1 text-3xl font-semibold tracking-tight tabular-nums; } .tab { - @apply rounded-lg px-3.5 py-1.5 text-sm font-medium text-stone-600 hover:bg-stone-200/60 dark:text-stone-300 dark:hover:bg-white/10; + @apply inline-flex min-h-11 items-center rounded-lg px-3.5 py-1.5 text-sm font-medium text-stone-600 sm:min-h-0 hover:bg-stone-200/60 dark:text-stone-300 dark:hover:bg-white/10; } .tab-active { - @apply bg-emerald-600 text-white hover:bg-emerald-600 dark:bg-emerald-600 dark:text-white dark:hover:bg-emerald-600; + @apply bg-emerald-700 text-white hover:bg-emerald-700 dark:bg-emerald-700 dark:text-white dark:hover:bg-emerald-700; } .track { @apply h-2 overflow-hidden rounded-full bg-stone-200/80 dark:bg-white/10; diff --git a/templates/ammunition/list.html b/templates/ammunition/list.html index ce22bca..9d3380b 100644 --- a/templates/ammunition/list.html +++ b/templates/ammunition/list.html @@ -35,11 +35,11 @@

{% trans 'Ammunition' %}

- - - - - + + + + + @@ -50,7 +50,7 @@

{% trans 'Ammunition' %}

{% if item.ammunition.bullet_type %}

{{ item.ammunition.bullet_type }}

{% endif %} - + - - - - - - + + + + + + diff --git a/templates/autonomy/partials/dashboard_summary.html b/templates/autonomy/partials/dashboard_summary.html index 7ee0d60..a3f9682 100644 --- a/templates/autonomy/partials/dashboard_summary.html +++ b/templates/autonomy/partials/dashboard_summary.html @@ -11,11 +11,11 @@

{% trans 'Autonomy' %}

{% for ring in rings %}
-
+
{% if ring.days is not None %} {{ ring.days|floatformat:0 }}{% trans 'days' %} - {% else %}β€”{% endif %} + {% else %}β€”{% endif %}

{{ ring.label }}

diff --git a/templates/base.html b/templates/base.html index d7a7c03..dea194b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -28,10 +28,11 @@ + {% block body %} - + -
@@ -77,32 +78,32 @@
-
+
-
+
{% if request.read_only %} -

{% trans 'Read-only account: you can look at everything but cannot change anything.' %}

+

{% trans 'Read-only account: you can look at everything but cannot change anything.' %}

{% endif %} {% include 'partials/messages.html' %} {% block content %}{% endblock %} diff --git a/templates/core/login.html b/templates/core/login.html index fff3852..992c4e3 100644 --- a/templates/core/login.html +++ b/templates/core/login.html @@ -10,28 +10,20 @@
-
+
{% include 'partials/messages.html' %}
V.A.U.L.T

V.A.U.L.T

-

{% trans 'Verified Assets, Usage, Lots and Tracking' %}

+

{% trans 'Verified Assets, Usage, Lots and Tracking' %}

{% trans 'Sign in to see your inventory.' %}

{% csrf_token %} - {% if form.non_field_errors %} -

{{ form.non_field_errors.0 }}

- {% endif %} - {% for field in form %} -
- - {{ field }} -
- {% endfor %} + {% include 'partials/form_fields.html' %} - diff --git a/templates/core/setup.html b/templates/core/setup.html index e2254ca..30bb7de 100644 --- a/templates/core/setup.html +++ b/templates/core/setup.html @@ -5,7 +5,7 @@
{% include 'partials/language_switcher.html' %}
-
+
V.A.U.L.T @@ -15,7 +15,7 @@

{% trans 'Welcome to V.A.
{% csrf_token %} {% include 'partials/form_fields.html' %} - diff --git a/templates/inventory/dashboard.html b/templates/inventory/dashboard.html index 7a66b72..cfe5f05 100644 --- a/templates/inventory/dashboard.html +++ b/templates/inventory/dashboard.html @@ -10,7 +10,7 @@

{{ greeting }}

{% blocktrans count n=expiring_count %}{{ n }} batch expires within {{ warning_days }} days{% plural %}{{ n }} batches expire within {{ warning_days }} days{% endblocktrans %}, {% blocktrans count n=low_stock_count %}{{ n }} item is below its minimum.{% plural %}{{ n }} items are below their minimum.{% endblocktrans %} {% else %}{% trans 'Everything is in order.' %}{% endif %} - Β· {% trans 'l, F j, Y' as long_date %}{{ today|date:long_date }} + Β· {% trans 'l, F j, Y' as long_date %}{{ today|date:long_date }}

@@ -84,7 +84,7 @@

{% trans 'Below minimum stock' %}

{{ item.name }}

{{ item.total|floatformat:"-3" }} / {{ item.min_stock|floatformat:"-3" }} {{ item.unit_symbol }}

-
+ @@ -113,7 +113,7 @@

{% trans 'By category' %}

  • {{ category.name }} {% widthratio category.item_count biggest_category 100 as percent %} -
    + {% blocktrans count n=category.item_count %}{{ n }} item{% plural %}{{ n }} items{% endblocktrans %} Β· {% blocktrans count n=category.batch_count %}{{ n }} batch{% plural %}{{ n }} batches{% endblocktrans %}
  • {% endfor %} diff --git a/templates/inventory/insights.html b/templates/inventory/insights.html index a9d3b66..3fad3a2 100644 --- a/templates/inventory/insights.html +++ b/templates/inventory/insights.html @@ -23,10 +23,10 @@

    {% trans 'How long each item lasts' %}

    {% trans 'Ammunition' %}{% trans 'Caliber' %}{% trans 'Rounds' %}{% trans 'Ammunition' %}{% trans 'Caliber' %}{% trans 'Rounds' %}
    {{ item.ammunition.caliber }} {{ item.total|floatformat:"-3" }} diff --git a/templates/ammunition/usage_list.html b/templates/ammunition/usage_list.html index ff09b26..c6e88ad 100644 --- a/templates/ammunition/usage_list.html +++ b/templates/ammunition/usage_list.html @@ -19,12 +19,12 @@

    {% trans 'Usage history' %}

    {% trans 'Date' %}{% trans 'Ammunition' %}{% trans 'Rounds' %}{% trans 'Reason' %}{% trans 'Date' %}{% trans 'Ammunition' %}{% trans 'Rounds' %}{% trans 'Reason' %}
    - - - - + + + + @@ -74,7 +74,7 @@

    {% trans 'How long each item lasts' %}

    {% for category in value.categories %}
  • {{ category.name }} -
    + {{ category.value|money }}
  • {% endfor %} @@ -91,8 +91,8 @@

    {% trans 'Movements' %}

    {% blocktrans %}Last {{ recent_days }} days{% endblocktrans %}

    {% if mix.total %}
    -
    -
    +
      @@ -112,7 +112,7 @@

      {% trans 'Who recorded' %}

      {% for row in users %}
      {{ row.label }}{{ row.count }}
      -
      +
      {% empty %}

      {% trans 'No movements in this period.' %}

      @@ -125,7 +125,7 @@

      {% trans 'Most used items' %}

      {% for row in used %}
      {{ row.label }}{{ row.count }}
      -
      +
      {% empty %}

      {% trans 'No exits in this period.' %}

      @@ -142,8 +142,8 @@

      {% trans 'Activity by day' %}

      {% if activity.busiest_day %}

      {% blocktrans with day=activity.busiest_day|date:'SHORT_DATE_FORMAT' count=activity.busiest_count %}Busiest day: {{ day }} ({{ count }}){% endblocktrans %}

      {% endif %}
    -
    -
    {% trans 'Item' %}{% trans 'In stock' %}{% trans 'Lasts' %}{% trans 'Item' %}{% trans 'In stock' %}{% trans 'Lasts' %}
    - - - - - - + + + + + + @@ -17,7 +17,7 @@ - +
    {% trans 'Item' %}{% trans 'Stock' %}{% trans 'Item' %}{% trans 'Stock' %}
    {{ item.total|floatformat:"-3" }} {{ item.unit_symbol }}
    {% if item.total < item.min_stock %}{% trans 'Low' %}{% endif %} diff --git a/templates/inventory/partials/stock_panel.html b/templates/inventory/partials/stock_panel.html index 1bfea32..6b405a8 100644 --- a/templates/inventory/partials/stock_panel.html +++ b/templates/inventory/partials/stock_panel.html @@ -17,14 +17,14 @@

    {{ next_batch.quantity|floatformat:"-3" }} {{ item.unit_symbol }} Β· {{ next_batch.location.name }}

    {% if next_batch.expires_at %}{% trans 'Expires at' %} {{ next_batch.expires_at|date:'SHORT_DATE_FORMAT' }}{% else %}{% trans 'No expiry date' %}{% endif %}{% if next_batch.packaged_at %} Β· {% trans 'Packaged' %} {{ next_batch.packaged_at|date:'SHORT_DATE_FORMAT' }}{% endif %}

    {% else %} -

    β€”

    +

    β€”

    {% endif %}
    + hx-post="{% url 'inventory:item_entry' item.pk %}" hx-target="#stock-panel" hx-swap="outerHTML" hx-disabled-elt="find button[type='submit']"> {% csrf_token %}

    {% trans 'Add stock' %}

    {% include 'partials/form_fields.html' with form=entry_form %} @@ -32,7 +32,7 @@

    {% trans 'Add stock' %}

    + hx-post="{% url 'inventory:item_exit' item.pk %}" hx-target="#stock-panel" hx-swap="outerHTML" hx-disabled-elt="find button[type='submit']"> {% csrf_token %}

    {% trans 'Remove stock' %}

    {% trans 'Leave it on automatic to take the batch that expires first, then the oldest packaged. Or choose where to take from.' %}

    @@ -47,13 +47,13 @@

    {% trans 'Remove stock' %}

    - - - - - - - + + + + + + + @@ -71,7 +71,7 @@

    {% trans 'Remove stock' %}

    {% trans 'Made' %} {{ batch.produced_at|date:'SHORT_DATE_FORMAT' }}

    {% if not batch.packaged_at %}

    {% blocktrans with age=batch.produced_at|age %}{{ age }} ago{% endblocktrans %}

    {% endif %} {% endif %} - {% if not batch.packaged_at and not batch.produced_at %}β€”{% endif %} + {% if not batch.packaged_at and not batch.produced_at %}β€”{% endif %} - - - - - - + + + + + + diff --git a/templates/inventory/simple_list.html b/templates/inventory/simple_list.html index 0071288..1dd45cf 100644 --- a/templates/inventory/simple_list.html +++ b/templates/inventory/simple_list.html @@ -10,9 +10,9 @@

    {{ title }}

    {% trans 'Location' %}{% trans 'Expires at' %}{% trans 'Quantity' %}{% trans 'Location' %}{% trans 'Expires at' %}{% trans 'Quantity' %}
    @@ -79,7 +79,7 @@

    {% trans 'Remove stock' %}

    {{ batch.expires_at|date:'SHORT_DATE_FORMAT' }} {% if row.days_left < 0 %}{% trans 'Expired' %} {% elif row.expiring %}{{ row.days_left }} d{% endif %} - {% else %}β€”{% endif %} + {% else %}β€”{% endif %}
    {{ batch.quantity|floatformat:"-3" }} {{ item.unit_symbol }} @@ -90,7 +90,7 @@

    {% trans 'Remove stock' %}

    + hx-post="{% url 'inventory:batch_transfer' batch.pk %}" hx-target="#stock-panel" hx-swap="outerHTML" hx-disabled-elt="find button[type='submit']"> {% csrf_token %}

    {% trans 'Transfer stock' %}

    @@ -106,7 +106,7 @@

    {% trans 'Transfer stock' %}

    + hx-post="{% url 'inventory:batch_adjust' batch.pk %}" hx-target="#stock-panel" hx-swap="outerHTML" hx-disabled-elt="find button[type='submit']"> {% csrf_token %}

    {% trans 'Adjust batch' %}

    diff --git a/templates/inventory/shopping_list.html b/templates/inventory/shopping_list.html index e448ad4..85a51ad 100644 --- a/templates/inventory/shopping_list.html +++ b/templates/inventory/shopping_list.html @@ -5,9 +5,9 @@

    {% trans 'Shopping list' %}

    -

    {% trans 'Everything below its minimum stock, with the amount to buy.' %}

    +

    {% trans 'Everything below its minimum stock, with the amount to buy.' %}

    - {% if lines %}{% endif %} + {% if lines %}{% trans 'Download PDF' %}{% endif %}
    @@ -15,12 +15,12 @@

    {% trans 'Shopping list' %}

    {% trans 'Item' %}{% trans 'Have' %}{% trans 'Buy' %}{% trans 'Item' %}{% trans 'Have' %}{% trans 'Buy' %}
    - - - + + + diff --git a/templates/inventory/stock_count.html b/templates/inventory/stock_count.html index 18156da..3123dd9 100644 --- a/templates/inventory/stock_count.html +++ b/templates/inventory/stock_count.html @@ -24,11 +24,11 @@

    {% trans 'Stock count' %}

    {% trans 'Name' %}{{ usage_label }}{% trans 'Name' %}{{ usage_label }}
    - - - - - + + + + + @@ -36,7 +36,7 @@

    {% trans 'Stock count' %}

    - + diff --git a/templates/kits/detail.html b/templates/kits/detail.html index 156df63..f46fa75 100644 --- a/templates/kits/detail.html +++ b/templates/kits/detail.html @@ -4,12 +4,12 @@ {% block content %}
    - ← {% trans 'Kits' %} + ← {% trans 'Kits' %}

    {{ kit.name }}

    {{ kit.location.name }}{% if kit.description %} Β· {{ kit.description }}{% endif %}

    -
    - +
    + {% trans 'Download PDF' %} {% trans 'Edit' %} {% csrf_token %} @@ -39,18 +39,16 @@

    {{ kit.name }}

    {% trans 'Item' %}{% trans 'In the system' %}{% trans 'Counted' %}{% trans 'Item' %}{% trans 'In the system' %}{% trans 'Counted' %}
    {{ batch.item.name }} {{ batch.quantity|floatformat:"-3" }} {{ batch.item.unit_symbol }}
    - - - - - - + + + + + {% for line in status.lines %} - @@ -62,10 +60,10 @@

    {{ kit.name }}

    {% if line.expiring %}{% trans 'Expiring' %}{% endif %} - @@ -77,7 +75,7 @@

    {{ kit.name }}

    {% endif %} - + {% csrf_token %}

    {% trans 'Add to the list' %}

    {% trans 'Adding an item that is already listed updates its required quantity.' %}

    diff --git a/templates/kits/partials/dashboard_summary.html b/templates/kits/partials/dashboard_summary.html index 7b6f7ae..8ecdc27 100644 --- a/templates/kits/partials/dashboard_summary.html +++ b/templates/kits/partials/dashboard_summary.html @@ -17,7 +17,7 @@

    {% trans 'Kits' %}

    {% elif status.lines %}{% trans 'Incomplete' %} {% else %}{% trans 'Empty list' %}{% endif %} -
    +

    diff --git a/templates/medications/list.html b/templates/medications/list.html index b74ee86..00540ef 100644 --- a/templates/medications/list.html +++ b/templates/medications/list.html @@ -14,11 +14,11 @@

    {% trans 'Medications' %}

    {% trans 'Item' %}{% trans 'In the kit' %}{% trans 'Required' %}{% trans 'Item' %}{% trans 'In the kit' %}{% trans 'Required' %}
    {{ line.item.name }} {{ line.valid|floatformat:"-3" }} {{ line.item.unit_symbol }} {{ line.required|floatformat:"-3" }} {{ line.item.unit_symbol }} + {% csrf_token %} - +
    - - - - - + + + + + @@ -31,7 +31,7 @@

    {% trans 'Medications' %}

    - + {% empty %} diff --git a/templates/partials/form_fields.html b/templates/partials/form_fields.html index 6713dbd..fe67c18 100644 --- a/templates/partials/form_fields.html +++ b/templates/partials/form_fields.html @@ -1,15 +1,26 @@ +{% load i18n %} +{% if form.errors|length > 1 %} + +{% else %} {% for error in form.non_field_errors %} -

    {{ error }}

    + {% endfor %} +{% endif %} {% for field in form %}
    {% if field.widget_type == 'checkbox' %} {% else %} - + {{ field }} {% endif %} - {% if field.help_text %}
    {{ field.help_text }}
    {% endif %} - {% for error in field.errors %}

    {{ error }}

    {% endfor %} + {% if field.help_text %}
    {{ field.help_text }}
    {% endif %} + {% for error in field.errors %}{% endfor %}
    {% endfor %} diff --git a/templates/partials/messages.html b/templates/partials/messages.html index 83f1a5d..a0a39e4 100644 --- a/templates/partials/messages.html +++ b/templates/partials/messages.html @@ -1,3 +1,3 @@ {% for message in messages %} -

    {{ message }}

    +

    {{ message }}

    {% endfor %} diff --git a/templates/partials/nav_links.html b/templates/partials/nav_links.html index efae603..97dda02 100644 --- a/templates/partials/nav_links.html +++ b/templates/partials/nav_links.html @@ -1,18 +1,18 @@ {% load i18n nav %} -

    {% trans 'Overview' %}

    -{% trans 'Dashboard' %} -{% trans 'Insights' %} -{% trans 'Shopping list' %} -{% trans 'Notifications' %}{% if alert_count %}{{ alert_count }}{% endif %} -

    {% trans 'Stock' %}

    -{% trans 'Items' %} -{% trans 'Kits' %} -{% trans 'Medications' %} -{% trans 'Ammunition' %} -{% trans 'Autonomy' %} -

    {% trans 'Manage' %}

    -{% trans 'Stock count' %} -{% trans 'Import CSV' %} -{% trans 'Categories' %} -{% trans 'Locations' %} -{% trans 'Movements' %} +

    {% trans 'Overview' %}

    +{% trans 'Dashboard' %} +{% trans 'Insights' %} +{% trans 'Shopping list' %} +{% trans 'Notifications' %}{% if alert_count %}{{ alert_count }}{% endif %} +

    {% trans 'Stock' %}

    +{% trans 'Items' %} +{% trans 'Kits' %} +{% trans 'Medications' %} +{% trans 'Ammunition' %} +{% trans 'Autonomy' %} +

    {% trans 'Manage' %}

    +{% trans 'Stock count' %} +{% trans 'Import CSV' %} +{% trans 'Categories' %} +{% trans 'Locations' %} +{% trans 'Movements' %} diff --git a/tests/core/test_accessibility.py b/tests/core/test_accessibility.py new file mode 100644 index 0000000..a2435bd --- /dev/null +++ b/tests/core/test_accessibility.py @@ -0,0 +1,173 @@ +import re +from http import HTTPStatus + +import pytest +from django.contrib.messages import ERROR, SUCCESS +from django.contrib.messages.storage.base import Message +from django.template import Context, Template +from django.template.loader import render_to_string +from django.urls import reverse + +from apps.core.forms import BackupForm + + +def _page(client, name, *args): + return client.get(reverse(name, args=args)).content.decode() + + +def test_every_page_has_a_skip_link_to_the_main_content(auth_client): + page = _page(auth_client, 'inventory:dashboard') + + assert 'class="skip-link"' in page + assert 'href="#main"' in page + assert re.search(r'
    ]*aria-current="page"', page) + assert not re.search(r'href="/kits/"[^>]*aria-current="page"', page) + + +def test_the_dashboard_is_current_only_on_the_dashboard(auth_client): + page = _page(auth_client, 'inventory:dashboard') + + assert re.search(r'href="/"[^>]*aria-current="page"', page) + assert not re.search(r'href="/items/"[^>]*aria-current="page"', page) + + +@pytest.mark.parametrize( + ('path', 'expected'), + [('/items/', 'aria-current="page"'), ('/kits/', '')], +) +def test_nav_current_tag(rf, path, expected): + template = Template("{% load nav %}[{% nav_current '/items/' %}]") + + rendered = template.render(Context({'request': rf.get(path)})) + + assert rendered == f'[{expected}]' + + +def test_tables_name_their_columns(auth_client, item, batch): + page = _page(auth_client, 'inventory:item_list') + + assert '
    {% trans 'Medication' %}{% trans 'Stock' %}{% trans 'Next expiry' %}{% trans 'Medication' %}{% trans 'Stock' %}{% trans 'Next expiry' %}
    {{ item.total|floatformat:"-3" }} {{ item.unit_symbol }}{% if item.next_expiry %}{{ item.next_expiry|date:'SHORT_DATE_FORMAT' }}{% else %}β€”{% endif %}{% if item.next_expiry %}{{ item.next_expiry|date:'SHORT_DATE_FORMAT' }}{% else %}β€”{% endif %}
    {% trans 'No medications yet.' %}
    ]*>Quantidade]*>\s*= 2 + assert data.count(b'(Qty)') == _pages(data) + + +def test_a_short_table_has_one_page(): + assert _pages(_document([['Rice', '1']])) == 1 + + +def test_checkboxes_draw_one_box_per_row(): + data = _document([['Rice', '1'], ['Beans', '2']], checkboxes=True) + + assert data.count(b' re S') == 2 + assert b' re S' not in _document([['Rice', '1']]) + + +def test_the_total_line_is_added_in_bold(): + data = _document([['Rice', '1']], total=('Total', '9,00')) + + assert re.search(rb'/F2 10.0 Tf [\d. ]+Td \(Total\)', data) + assert re.search(rb'/F2 10.0 Tf [\d. ]+Td \(9,00\)', data) + + +def test_the_total_starts_a_new_page_when_the_last_one_is_full(): + rows = [[f'Item {number}', '1'] for number in range(29)] + one_page = _document(rows) + with_total = _document(rows, total=('Total', '1')) + + assert _pages(with_total) >= _pages(one_page) + + +def test_text_width_uses_the_helvetica_metrics(): + assert pdf.text_width('A', 1000) == 667 + assert pdf.text_width('A', 1000, bold=True) == 722 + assert pdf.text_width('\n', 10) == 0 + + +def test_fit_cuts_long_text_with_an_ellipsis(): + cut = pdf.fit('A very long item name indeed', 10, 60) + + assert cut.endswith(pdf.ELLIPSIS) + assert pdf.text_width(cut, 10) <= 60 + + +def test_fit_keeps_text_that_already_fits(): + assert pdf.fit('Rice', 10, 200) == 'Rice' diff --git a/tests/inventory/test_shopping.py b/tests/inventory/test_shopping.py index 45499d4..56dfb7a 100644 --- a/tests/inventory/test_shopping.py +++ b/tests/inventory/test_shopping.py @@ -80,3 +80,34 @@ def test_shopping_list_page_when_nothing_is_missing(auth_client): assert response.status_code == HTTPStatus.OK assert 'Nada para comprar' in response.content.decode() + + +def test_shopping_pdf_downloads_the_list(auth_client, category, location): + item = _item(category, 'Rice', 10) + services.add_stock( + item, location, Decimal(4), EntryDetails(unit_cost=Decimal(2)) + ) + + response = auth_client.get(reverse('inventory:shopping_pdf')) + + assert response.status_code == HTTPStatus.OK + assert response['Content-Type'] == 'application/pdf' + assert 'shopping-list-' in response['Content-Disposition'] + assert response.content.startswith(b'%PDF-') + assert b'Rice' in response.content + assert b'R$ 12,00' in response.content + + +def test_shopping_pdf_when_nothing_is_missing(auth_client): + response = auth_client.get(reverse('inventory:shopping_pdf')) + + assert response.status_code == HTTPStatus.OK + assert response.content.startswith(b'%PDF-') + + +def test_shopping_page_links_to_the_pdf(auth_client, category): + _item(category, 'Rice', 10) + + response = auth_client.get(reverse('inventory:shopping_list')) + + assert reverse('inventory:shopping_pdf') in response.content.decode() diff --git a/tests/kits/test_kits.py b/tests/kits/test_kits.py index 1082959..90f4f91 100644 --- a/tests/kits/test_kits.py +++ b/tests/kits/test_kits.py @@ -505,3 +505,38 @@ def test_a_kit_location_is_skipped_by_automatic_exits(category, kit): shelf.refresh_from_db() assert in_kit.quantity == Decimal(5) assert shelf.quantity == Decimal(1) + + +def test_pdf_downloads_the_checklist(auth_client, kit, category): + item = _item(category, 'Gauze') + services.set_kit_item(kit, item, Decimal(4)) + _stock(item, kit.location, 1) + + response = auth_client.get(reverse('kits:pdf', args=[kit.pk])) + + assert response.status_code == HTTPStatus.OK + assert response['Content-Type'] == 'application/pdf' + assert 'kit-go-bag-1.pdf' in response['Content-Disposition'] + assert b'Gauze' in response.content + + +def test_pdf_of_a_kit_with_a_description_and_no_items(auth_client, kit): + response = auth_client.get(reverse('kits:pdf', args=[kit.pk])) + + assert response.status_code == HTTPStatus.OK + assert b'Car trunk' in response.content + + +def test_pdf_of_a_missing_kit_is_not_found(auth_client, db): + response = auth_client.get(reverse('kits:pdf', args=[999])) + + assert response.status_code == HTTPStatus.NOT_FOUND + + +def test_pdf_of_a_kit_without_a_description(auth_client, db): + bare = services.create_kit('Bare kit') + + response = auth_client.get(reverse('kits:pdf', args=[bare.pk])) + + assert response.status_code == HTTPStatus.OK + assert b'Bare kit' in response.content