Files
GerbilManager/gerbil-manager-web/src/index.css
Gulum b83e96f552 feat: Rennmausakte, Zucht-Suffix, Gehege-Bilder, Toasts, Infinite-Scroll
Detailseite (Rennmausakte):
- Neugestaltung: Hero-Foto + Overlay, Schnellfakten-Pills, Karten-Sektionen,
  Charakter als Chips, getabte Fotos/Gesundheit/Gewicht.
- Eltern (Vater/Mutter) als Links; Charakter-Karte klappt bei Status
  Abgabe/Verstorben/Abgegeben ein (nur Zucht/Liebhaber offen).
- Gehege wird bei abgegebenen/verstorbenen Tieren ausgeblendet (Detail + Formular).

Listen:
- Infinite Scroll auf allen Listen (Rennmäuse, Würfe, Gehege, Verträge,
  Anfragen, Kontakte) via useInfiniteList/useInfiniteSentinel; stabile
  Sortierung mit id-Tiebreaker (keine doppelten Keys), Back-to-top-Button.
- Kontakte: Rolle-Filter (Züchter/Abnehmer) als Quick-Chips + Sticky-Header.

Zucht-Nachname:
- Namens-Anhängsel der Zucht in den Einstellungen + je Züchter-Kontakt
  (Backend-Spalten + Migration); eigene Tiere zeigen „Name + Suffix".
- „Eigene Zucht" ist die Standard-Herkunft neuer Tiere.

Weiteres:
- Gehege-Bilder: Upload/Galerie auf der Gehege-Detailseite (Backend
  EnclosurePhoto + Endpoints + Migration, geteilte Dateiablage).
- Toast-Rückmeldungen für alle Speichern-Aktionen.
- Checkboxen durch mobile-freundliche Toggle-Schalter ersetzt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 13:35:30 +02:00

997 lines
20 KiB
CSS

/* Mobile-first Grundlayout: Tab-Leiste unten auf dem Smartphone,
Seitenleiste links ab 768px (Laptop). */
:root {
/* DESIGN (Rennmaus Filter): the app palette is the design's creme/brown/terracotta. */
--color-bg: #f6efe2;
--color-surface: #ffffff;
--color-border: #e7dcc8;
--color-text: #3d2e23;
--color-text-muted: #8c7f6e;
--color-text-faint: #b4a790;
--color-accent: #a85f2e;
--color-accent-soft: #f3e7da;
/* DESIGN (Rennmaus Filter): the single soft elevation used on cards, pills,
the search bar and buttons. */
--shadow: 0 1px 2px rgba(61, 46, 35, 0.06), 0 2px 8px rgba(61, 46, 35, 0.05);
font-family: 'Hanken Grotesk', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
line-height: 1.5;
color: var(--color-text);
background-color: var(--color-bg);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100dvh;
}
h1,
h2,
h3 {
margin: 0 0 0.5rem;
}
a {
color: var(--color-accent);
}
/* --- Grundgerüst (Smartphone) --- */
/* DESIGN: the top "Rennmaus-Manager" title bar is removed; on mobile only the
bottom action bar remains, on desktop the left sidebar.
The shell is a fixed viewport box and ONLY the main area scrolls — so the bottom
nav (mobile) and the sidebar (desktop) stay put, and the page header's
position: sticky pins reliably to the top of the scrolling main area. */
.app-shell {
display: grid;
height: 100dvh;
overflow: hidden;
grid-template-rows: 1fr auto;
grid-template-areas:
'main'
'nav';
}
.app-main {
grid-area: main;
/* No top padding: the page's sticky header pins flush to the top with no gap
(pages add their own top spacing via .page). */
padding: 0 1rem 1.5rem;
max-width: 60rem;
width: 100%;
/* MAIN is the scroll container: min-height:0 lets the 1fr grid row shrink below
its content so it can scroll. overflow-anchor:none stops the browser from
re-adjusting scroll when the sticky title collapses (no scroll "fight"). */
min-height: 0;
overflow-y: auto;
overflow-x: hidden;
overflow-anchor: none;
}
/* Top spacing for page content (replaces the removed .app-main top padding). The
Rennmäuse page opts out — its sticky header provides its own top padding. */
.page {
padding-top: 1rem;
}
/* Tab-Leiste unten */
.app-nav {
grid-area: nav;
display: flex;
justify-content: space-around;
background: var(--color-surface);
border-top: 1px solid var(--color-border);
position: sticky;
bottom: 0;
/* Above the sticky page header + cards so it is never overlapped. */
z-index: 30;
padding-bottom: env(safe-area-inset-bottom);
}
.nav-link {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.15rem;
padding: 0.5rem 0.75rem;
flex: 1;
font-size: 0.7rem;
text-decoration: none;
color: var(--color-text-muted);
min-height: 44px; /* Touch-Ziel */
}
.nav-link--active {
color: var(--color-accent);
font-weight: 600;
}
.nav-icon {
font-size: 1.25rem;
}
/* --- Laptop / Tablet (ab 768px): Seitenleiste links --- */
@media (min-width: 768px) {
.app-shell {
grid-template-columns: 14rem 1fr;
grid-template-rows: 1fr;
grid-template-areas: 'nav main';
}
.app-nav {
flex-direction: column;
justify-content: flex-start;
gap: 0.25rem;
border-top: none;
border-right: 1px solid var(--color-border);
padding: 1rem 0.5rem;
position: static;
/* Sidebar stays fixed; scrolls internally only if the link list is taller
than the viewport. */
overflow-y: auto;
}
.nav-link {
flex-direction: row;
flex: 0 0 auto;
gap: 0.6rem;
font-size: 0.95rem;
padding: 0.6rem 0.75rem;
border-radius: 0.5rem;
}
.nav-link:hover {
background: var(--color-accent-soft);
}
.nav-link--active {
background: var(--color-accent-soft);
}
.app-main {
padding: 0 2rem 1.5rem;
}
}
/* ── Shared UI ───────────────────────────────────────────────── */
.muted {
color: var(--color-text-muted);
margin: 0.25rem 0;
}
.page-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
min-height: 44px;
padding: 0.5rem 1rem;
border: 1px solid var(--color-border);
border-radius: 0.5rem;
background: var(--color-surface);
color: var(--color-text);
font: inherit;
cursor: pointer;
text-decoration: none;
}
.btn:hover:not(:disabled) {
background: var(--color-accent-soft);
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn--primary {
background: var(--color-accent);
border-color: var(--color-accent);
color: #fff;
}
.btn--primary:hover:not(:disabled) {
filter: brightness(0.95);
background: var(--color-accent);
}
.btn--danger {
border-color: #b54a4a;
color: #b54a4a;
}
.input,
select,
textarea {
font: inherit;
padding: 0.5rem 0.6rem;
border: 1px solid var(--color-border);
border-radius: 0.5rem;
background: var(--color-surface);
color: var(--color-text);
min-height: 44px;
width: 100%;
}
textarea {
min-height: 5rem;
resize: vertical;
}
.alert {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
margin: 0.75rem 0;
}
.alert--error {
background: #fbeaea;
border: 1px solid #e3b3b3;
color: #8a2f2f;
}
/* ── Filters ─────────────────────────────────────────────────── */
.filters {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
align-items: flex-end;
margin: 1rem 0;
}
.filters .input[type='search'] {
flex: 1 1 12rem;
}
.field {
display: flex;
flex-direction: column;
gap: 0.25rem;
font-size: 0.85rem;
color: var(--color-text-muted);
}
.field > select,
.field > .input {
min-width: 9rem;
}
/* ── Card list (mobile-first); table-like rows on wider screens ── */
.card-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.gerbil-card {
display: grid;
grid-template-columns: 1fr auto;
gap: 0.25rem 0.75rem;
align-items: center;
padding: 0.75rem 1rem;
border: 1px solid var(--color-border);
border-radius: 0.6rem;
background: var(--color-surface);
text-decoration: none;
color: var(--color-text);
}
.gerbil-card:hover {
background: var(--color-accent-soft);
}
.gerbil-card__name {
font-weight: 600;
}
.gerbil-card__meta {
font-size: 0.85rem;
color: var(--color-text-muted);
}
.badge {
justify-self: end;
font-size: 0.72rem;
padding: 0.15rem 0.5rem;
border-radius: 1rem;
background: var(--color-accent-soft);
color: var(--color-accent);
white-space: nowrap;
}
.badge--deceased {
background: #ececec;
color: #666;
}
.badge--givenaway {
background: #e7eef6;
color: #3a6ea5;
}
/* BESTAND-FILTER: subtle marker for external (non-Bestand) animals. Inline next
to the name, so it should not be pushed to the grid edge like the status badge. */
.badge--external {
justify-self: start;
margin-left: 0.4rem;
vertical-align: middle;
background: #f0f0f0;
color: #777;
border: 1px dashed #bbb;
}
/* Checkbox-style filter (label text + toggle on one row), vs. the stacked .field. */
.field--check {
flex-direction: row;
align-items: center;
justify-content: space-between;
gap: 0.4rem;
}
/* Toggle-switch styling for boolean checkboxes + the multi-select pickers
(mobile-friendlier than a checkbox). The element stays a real <input
type="checkbox"> — role, keyboard and form semantics are unchanged. */
.field--check input[type='checkbox'],
.wizard-pick input[type='checkbox'],
.namegen-usages-grid input[type='checkbox'] {
appearance: none;
-webkit-appearance: none;
flex: 0 0 auto;
position: relative;
width: 2.5rem;
height: 1.45rem;
min-height: 0;
margin: 0;
border: none;
border-radius: 999px;
background: var(--color-border);
cursor: pointer;
transition: background 0.18s ease;
}
.field--check input[type='checkbox']::after,
.wizard-pick input[type='checkbox']::after,
.namegen-usages-grid input[type='checkbox']::after {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: calc(1.45rem - 4px);
height: calc(1.45rem - 4px);
border-radius: 50%;
background: #fff;
box-shadow: 0 1px 2px rgba(61, 46, 35, 0.35);
transition: transform 0.18s ease;
}
.field--check input[type='checkbox']:checked,
.wizard-pick input[type='checkbox']:checked,
.namegen-usages-grid input[type='checkbox']:checked {
background: var(--color-accent);
}
.field--check input[type='checkbox']:checked::after,
.wizard-pick input[type='checkbox']:checked::after,
.namegen-usages-grid input[type='checkbox']:checked::after {
transform: translateX(calc(2.5rem - 1.45rem));
}
.field--check input[type='checkbox']:focus-visible,
.wizard-pick input[type='checkbox']:focus-visible,
.namegen-usages-grid input[type='checkbox']:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
@media (min-width: 768px) {
.gerbil-card {
grid-template-columns: 2fr 1fr 1.5fr 1fr auto;
grid-auto-flow: column;
}
.badge {
justify-self: start;
}
}
.pager {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
margin: 1.5rem 0;
}
/* ── Detail page ─────────────────────────────────────────────── */
.head-actions {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.def-list {
margin: 0.5rem 0 1.5rem;
}
.def-row {
display: grid;
grid-template-columns: 1fr;
gap: 0.1rem;
padding: 0.5rem 0;
border-bottom: 1px solid var(--color-border);
}
.def-row dt {
font-size: 0.8rem;
color: var(--color-text-muted);
}
.def-row dd {
margin: 0;
}
.def-row code {
background: var(--color-accent-soft);
padding: 0.1rem 0.4rem;
border-radius: 0.3rem;
font-size: 0.95em;
}
@media (min-width: 768px) {
.def-row {
grid-template-columns: 14rem 1fr;
gap: 1rem;
align-items: baseline;
}
}
.tabs {
display: flex;
gap: 0.25rem;
border-bottom: 1px solid var(--color-border);
margin-top: 1rem;
}
.tab {
background: none;
border: none;
border-bottom: 2px solid transparent;
padding: 0.6rem 0.9rem;
font: inherit;
color: var(--color-text-muted);
cursor: pointer;
min-height: 44px;
}
.tab--active {
color: var(--color-accent);
border-bottom-color: var(--color-accent);
font-weight: 600;
}
.tab-panel {
padding: 1rem 0;
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* ── Form ────────────────────────────────────────────────────── */
.form {
display: flex;
flex-direction: column;
gap: 1rem;
max-width: 32rem;
margin-top: 1rem;
}
.form .field > span {
font-size: 0.85rem;
color: var(--color-text-muted);
}
.error-text {
color: #b54a4a;
font-size: 0.8rem;
}
.form-actions {
display: flex;
gap: 0.75rem;
margin-top: 0.5rem;
}
/* ── Genetik / Probeverpaarung (FEAT-5) ──────────────────────── */
.parents-grid {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
margin: 1rem 0;
}
@media (min-width: 768px) {
.parents-grid {
grid-template-columns: 1fr 1fr;
}
}
.parent-selector {
border: 1px solid var(--color-border);
border-radius: 0.6rem;
padding: 0.75rem 1rem 1rem;
margin: 0;
}
.parent-selector legend {
font-weight: 600;
padding: 0 0.4rem;
}
.parent-selector__animal {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
}
.link-btn {
background: none;
border: none;
color: var(--color-accent);
cursor: pointer;
font: inherit;
padding: 0.25rem 0;
text-decoration: underline;
}
.alert--warning {
background: #fdf2dc;
border: 1px solid #e6c878;
color: #7a5a14;
}
.results {
margin-top: 1rem;
}
.farbschlag-cards {
list-style: none;
margin: 0.5rem 0 1rem;
padding: 0;
display: grid;
/* GEN-4: wider min-width prevents long names (CP-Silberagouti-Hell) from overflowing */
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
gap: 0.5rem;
}
/* GEN-4 layout fix: image left, body centre (name + genotype stacked), prob right.
align-items: stretch so all three columns fill the card height consistently. */
.farbschlag-card {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.6rem 0.9rem;
border: 1px solid var(--color-border);
border-radius: 0.6rem;
background: var(--color-surface);
overflow: hidden; /* contain long genotype strings */
}
.farbschlag-card__img {
flex-shrink: 0;
}
/* Body takes the middle space and allows wrapping for long names */
.farbschlag-card__body {
flex: 1;
min-width: 0; /* allow flex child to shrink below content size */
display: flex;
flex-direction: column;
gap: 0.15rem;
}
.farbschlag-card__name {
font-weight: 600;
overflow-wrap: break-word;
word-break: break-word;
}
/* Genotype code shown below the name — muted, small, wrappable */
.farbschlag-card__geno {
font-size: 0.7rem;
color: var(--color-text-muted, #666);
overflow-wrap: break-word;
word-break: break-all;
opacity: 0.8;
}
.farbschlag-card__prob {
flex-shrink: 0;
color: var(--color-accent);
white-space: nowrap;
text-align: right;
}
/* UX-MOBILE-2: scroll wrapper so genotype table scrolls horizontally on mobile
instead of overflowing the page. */
.genotype-table-scroll {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.genotype-table {
border-collapse: collapse;
margin-top: 0.75rem;
font-size: 0.9rem;
}
.genotype-table th,
.genotype-table td {
text-align: left;
padding: 0.4rem 0.5rem;
border-bottom: 1px solid var(--color-border);
white-space: nowrap;
}
.genotype-table code {
background: var(--color-accent-soft);
padding: 0.1rem 0.35rem;
border-radius: 0.3rem;
}
.animal-picker {
position: relative;
margin-bottom: 0.5rem;
}
.animal-picker__results {
list-style: none;
margin: 0.25rem 0 0;
padding: 0;
border: 1px solid var(--color-border);
border-radius: 0.5rem;
background: var(--color-surface);
max-height: 14rem;
overflow-y: auto;
}
.animal-picker__item {
display: block;
width: 100%;
text-align: left;
background: none;
border: none;
padding: 0.5rem 0.75rem;
font: inherit;
color: var(--color-text);
cursor: pointer;
min-height: 44px;
}
.animal-picker__item:hover {
background: var(--color-accent-soft);
}
.animal-picker__hint {
padding: 0.5rem 0.75rem;
}
.mismatch-hint {
color: #7a5a14;
margin-left: 0.4rem;
}
/* ── FEAT-6 (Oscar): Tier-Detail-Tabs — Gesundheit / Gewicht / Fotos ── */
/* Eintragskarten (Gesundheit, Gewichtsverlauf) */
.record-card {
padding: 0.75rem 1rem;
border: 1px solid var(--color-border);
border-radius: 0.6rem;
background: var(--color-surface);
}
.record-card__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
}
.record-card__date {
font-weight: 600;
}
.record-card__body {
margin: 0.4rem 0;
white-space: pre-wrap;
}
.record-card__actions {
display: flex;
gap: 0.5rem;
margin-top: 0.5rem;
}
.record-card--row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
}
/* Gewicht-Schnellerfassung: großes, daumenfreundliches Eingabefeld */
.weight-quick-add {
margin-bottom: 1.25rem;
}
.weight-quick-add__row {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
align-items: flex-end;
}
.input--xl {
font-size: 1.5rem;
min-height: 56px;
max-width: 9rem;
text-align: center;
}
/* Gewichts-Diagramm (eigenes SVG) */
.line-chart {
width: 100%;
height: auto;
max-width: 40rem;
margin: 0.5rem 0 1.25rem;
}
.line-chart__axis {
stroke: var(--color-text-muted);
stroke-width: 1;
}
.line-chart__grid {
stroke: var(--color-border);
stroke-width: 1;
stroke-dasharray: 3 3;
}
.line-chart__label {
fill: var(--color-text-muted);
font-size: 12px;
}
.line-chart__line {
stroke: var(--color-accent);
stroke-width: 2;
}
.line-chart__dot {
fill: var(--color-accent);
}
/* Foto-Galerie */
.photo-grid {
list-style: none;
margin: 1rem 0 0;
padding: 0;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
gap: 0.75rem;
}
.photo-card {
border: 1px solid var(--color-border);
border-radius: 0.6rem;
background: var(--color-surface);
overflow: hidden;
display: flex;
flex-direction: column;
}
.photo-card img {
width: 100%;
aspect-ratio: 1;
object-fit: cover;
display: block;
}
.photo-card__bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.4rem;
padding: 0.4rem 0.6rem;
}
.photo-card__caption {
font-size: 0.8rem;
color: var(--color-text-muted);
overflow-wrap: anywhere;
}
/* Profilfoto im Detail-Kopf */
.profile-header-summary {
display: flex;
align-items: center;
gap: 1.5rem;
}
.profile-header-info {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.profile-header-badges {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
align-items: center;
}
.profile-photo {
width: 200px;
height: 200px;
border-radius: 1.25rem;
object-fit: cover;
border: 4px solid var(--color-border);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile-photo:hover {
transform: translateY(-4px) scale(1.02);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.form-row-2col {
display: flex;
gap: 1rem;
align-items: flex-end;
margin-bottom: 0.5rem;
}
.form-row-2col > :first-child {
flex: 2;
min-width: 0;
}
.form-row-2col > :last-child {
flex: 1;
min-width: 0;
min-height: 44px;
display: flex;
align-items: center;
}
.form-group-box {
border: 1px solid var(--color-border);
border-radius: 0.6rem;
padding: 1.25rem;
background: var(--color-surface);
box-shadow: inset 0 1px 3px rgba(59, 48, 38, 0.02);
display: flex;
flex-direction: column;
gap: 1rem;
margin: 0.5rem 0 1.25rem 0;
max-width: 32rem; /* match form max-width */
}
.form-group-box__title {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.05em;
font-weight: 700;
color: var(--color-accent);
margin-bottom: 0.25rem;
border-bottom: 1px dashed var(--color-border);
padding-bottom: 0.5rem;
}
/* Gender Segmented Control / Radio Buttons */
.gender-selector-group {
display: flex;
gap: 0.5rem;
margin-top: 0.25rem;
max-width: 32rem;
}
.gender-btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
border: 1px solid var(--color-border);
background: var(--color-surface);
color: var(--color-text);
font-family: inherit;
font-size: 0.95rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease-in-out;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.gender-btn:hover {
background: var(--color-bg);
border-color: var(--color-text-muted);
}
.gender-btn__icon {
font-size: 1.15rem;
line-height: 1;
}
/* Active styles */
.gender-btn--male.is-active {
border-color: #3b82f6;
background: #eff6ff;
color: #1d4ed8;
box-shadow: 0 0 0 1px #3b82f6;
}
.gender-btn--male.is-active .gender-btn__icon {
color: #2563eb;
}
.gender-btn--female.is-active {
border-color: #ec4899;
background: #fdf2f8;
color: #be185d;
box-shadow: 0 0 0 1px #ec4899;
}
.gender-btn--female.is-active .gender-btn__icon {
color: #db2777;
}
.gender-btn--unknown.is-active {
border-color: #6b7280;
background: #f3f4f6;
color: #374151;
box-shadow: 0 0 0 1px #6b7280;
}
.gender-btn--unknown.is-active .gender-btn__icon {
color: #4b5563;
}