:root {
    --lab-bg: #f4f1ea;
    --lab-surface: #fffaf0;
    --lab-surface-2: #fbf3e3;
    --lab-ink: #24211d;
    --lab-muted: #766f66;
    --lab-line: #ded5c7;
    --lab-green: #256d5a;
    --lab-green-dark: #18483c;
    --lab-amber: #d88a2d;
    --lab-red: #b94a48;
    --lab-blue: #3d73a8;
    --lab-pink: #b65b8a;
    --lab-shadow: 0 18px 45px rgba(63, 48, 29, 0.12);
    --lab-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
    --lab-sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

body.lab-ui {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(216, 138, 45, 0.16), transparent 28rem),
        radial-gradient(circle at 84% 0%, rgba(37, 109, 90, 0.13), transparent 30rem),
        linear-gradient(135deg, #f8f4eb 0%, var(--lab-bg) 52%, #eee6d9 100%);
    color: var(--lab-ink);
    font-family: var(--lab-sans);
}

body.lab-ui .lab-shell {
    animation: lab-page-enter 0.42s ease-out both;
}

body.lab-ui .lab-hero,
body.lab-ui .metric-grid,
body.lab-ui .lab-filterbar,
body.lab-ui .lab-panel,
body.lab-ui .cage-workspace,
body.lab-ui .schedule-layout,
body.lab-ui .pedigree-layout {
    animation: lab-section-enter 0.5s ease-out both;
}

body.lab-ui .metric-grid,
body.lab-ui .lab-filterbar {
    animation-delay: 0.04s;
}

body.lab-ui .lab-panel,
body.lab-ui .cage-workspace,
body.lab-ui .schedule-layout,
body.lab-ui .pedigree-layout {
    animation-delay: 0.08s;
}

.lab-ui * {
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 109, 90, 0.58) rgba(239, 228, 210, 0.58);
}

.lab-ui *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.lab-ui *::-webkit-scrollbar-track {
    background: rgba(239, 228, 210, 0.48);
    border-radius: 999px;
}

.lab-ui *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(37, 109, 90, 0.78), rgba(24, 72, 60, 0.66));
    border: 2px solid rgba(255, 250, 240, 0.78);
    border-radius: 999px;
}

.lab-ui *::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--lab-green), var(--lab-green-dark));
}

.lab-ui *::-webkit-scrollbar-corner {
    background: transparent;
}

html:has(body.lab-ui) {
    scrollbar-width: none;
}

html:has(body.lab-ui)::-webkit-scrollbar,
body.lab-ui::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.lab-scrollbar {
    position: fixed;
    top: 86px;
    right: 7px;
    bottom: 22px;
    z-index: 40;
    width: 9px;
    border: 1px solid rgba(255, 250, 240, 0.56);
    border-radius: 999px;
    background: rgba(239, 228, 210, 0.42);
    box-shadow: 0 10px 28px rgba(63, 48, 29, 0.12);
    cursor: default;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, width 0.16s ease, background 0.16s ease;
    touch-action: none;
}

.lab-scrollbar.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.lab-scrollbar:hover,
.lab-scrollbar:focus-visible,
.lab-scrollbar.is-dragging {
    width: 15px;
    background: rgba(239, 228, 210, 0.66);
    outline: none;
}

.lab-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 2px;
    right: 2px;
    min-height: 34px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(37, 109, 90, 0.88), rgba(24, 72, 60, 0.74));
    box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.42), 0 8px 16px rgba(37, 109, 90, 0.2);
    cursor: default;
    transition: left 0.16s ease, right 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
    touch-action: none;
    will-change: transform;
}

.lab-scrollbar:hover .lab-scrollbar-thumb,
.lab-scrollbar:focus-visible .lab-scrollbar-thumb,
.lab-scrollbar.is-dragging .lab-scrollbar-thumb {
    left: 3px;
    right: 3px;
    background: linear-gradient(180deg, var(--lab-green), var(--lab-green-dark));
    box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.48), 0 12px 22px rgba(37, 109, 90, 0.26);
}


.lab-scrolltop {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 45;
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 250, 240, 0.72);
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(37, 109, 90, 0.94), rgba(24, 72, 60, 0.96)),
        var(--lab-green);
    color: #fffaf0;
    box-shadow: 0 18px 38px rgba(36, 33, 29, 0.2), inset 0 1px 0 rgba(255, 250, 240, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.94);
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.lab-scrolltop.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.lab-scrolltop:hover {
    box-shadow: 0 22px 46px rgba(36, 33, 29, 0.26), inset 0 1px 0 rgba(255, 250, 240, 0.22);
    transform: translateY(-2px) scale(1.02);
}

.lab-scrolltop span {
    margin-top: 2px;
    font-family: var(--lab-mono);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 0.8;
}

.lab-scrolltop small {
    margin-top: -6px;
    font-family: var(--lab-mono);
    font-size: 0.54rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.lab-ui::before {
    content: "";
    pointer-events: none;
    position: fixed;
    inset: 0;
    opacity: 0.34;
    background-image:
        linear-gradient(rgba(36, 33, 29, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 33, 29, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
    z-index: -1;
}

.lab-shell {
    max-width: 1680px;
    margin: 0 auto;
    padding: 24px 28px 40px;
}

.lab-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(36, 33, 29, 0.88) !important;
    border-bottom: 1px solid rgba(255, 250, 240, 0.14);
}

.lab-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border: 1px solid rgba(255, 250, 240, 0.36);
    border-radius: 10px;
    color: #f6d49f;
    font-family: var(--lab-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.lab-nav .navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.lab-nav .nav-link {
    color: rgba(255, 250, 240, 0.74) !important;
    border-radius: 999px;
    margin-left: 6px;
    transition: color 0.24s ease, background 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
}

.lab-nav .nav-link.active,
.lab-nav .nav-link:hover {
    color: #fffaf0 !important;
    background: linear-gradient(135deg, rgba(255, 250, 240, 0.18), rgba(255, 250, 240, 0.1)) !important;
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.08), 0 8px 20px rgba(0, 0, 0, 0.12);
}

.lab-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    margin: 24px 0 18px;
}

.eyebrow {
    color: var(--lab-green);
    font-family: var(--lab-mono);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.lab-title {
    margin: 8px 0 6px;
    font-size: clamp(2.1rem, 4vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 0.95;
}

.lab-subtitle {
    margin: 0;
    color: var(--lab-muted);
    max-width: 720px;
}

.lab-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-lab-primary,
.btn-lab-secondary,
.btn-lab-ghost,
.btn-lab-danger {
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    padding: 0.62rem 1.05rem;
}

.btn-lab-primary {
    background: var(--lab-green);
    color: #fffaf0;
    box-shadow: 0 12px 24px rgba(37, 109, 90, 0.22);
}

.btn-lab-primary:hover { background: var(--lab-green-dark); color: #fffaf0; }
.btn-lab-secondary { background: #efe4d2; color: var(--lab-ink); border-color: var(--lab-line); }
.btn-lab-secondary:hover { background: #e5d7c3; color: var(--lab-ink); }
.btn-lab-ghost { background: transparent; color: var(--lab-green); border-color: rgba(37, 109, 90, 0.24); }
.btn-lab-ghost:hover { background: rgba(37, 109, 90, 0.08); color: var(--lab-green-dark); }
.btn-lab-danger { background: rgba(185, 74, 72, 0.08); color: var(--lab-red); border-color: rgba(185, 74, 72, 0.24); }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    padding: 18px;
    background: rgba(255, 250, 240, 0.76);
    border: 1px solid rgba(222, 213, 199, 0.92);
    border-radius: 24px;
    box-shadow: var(--lab-shadow);
}

.metric-card::after {
    content: "";
    position: absolute;
    width: 124px;
    height: 124px;
    right: -48px;
    top: -48px;
    border-radius: 999px;
    background: rgba(37, 109, 90, 0.08);
}

.metric-label {
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 10px;
    font-family: var(--lab-mono);
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
}

.metric-note {
    margin-top: 8px;
    color: var(--lab-muted);
    font-size: 0.86rem;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.cage-rail,
.cage-board-panel,
.detail-panel,
.lab-panel {
    background: rgba(255, 250, 240, 0.88);
    border: 1px solid rgba(222, 213, 199, 0.96);
    border-radius: 28px;
    box-shadow: var(--lab-shadow);
}

.cage-workspace {
    display: block;
}

.cage-workspace.is-detail-mode .cage-board-panel {
    display: none;
}

.cage-detail-view.is-hidden {
    display: none;
}

.cage-board-panel {
    overflow: hidden;
}

.cage-rail {
    position: sticky;
    top: 86px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rail-header {
    padding: 18px;
    border-bottom: 1px solid var(--lab-line);
}

.rail-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rail-title h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
}

.rail-filters {
    display: grid;
    grid-template-columns: 1fr 130px;
    gap: 10px;
}

.lab-input,
.lab-select {
    border: 1px solid var(--lab-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--lab-ink);
    padding: 0.66rem 0.78rem;
    font-size: 0.9rem;
}

.lab-select,
.form-select {
    appearance: none;
    min-height: 44px;
    padding-right: 2.7rem;
    font-weight: 750;
    background-color: rgba(255, 250, 240, 0.82);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--lab-green-dark) 50%),
        linear-gradient(135deg, var(--lab-green-dark) 50%, transparent 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(239, 228, 210, 0.58));
    background-position:
        calc(100% - 22px) 50%,
        calc(100% - 16px) 50%,
        0 0;
    background-size:
        6px 6px,
        6px 6px,
        100% 100%;
    background-repeat: no-repeat;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 18px rgba(63, 48, 29, 0.05);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.lab-select:hover,
.form-select:hover {
    border-color: rgba(37, 109, 90, 0.38);
    background-color: rgba(255, 250, 240, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 10px 22px rgba(63, 48, 29, 0.08);
}

.lab-input:focus,
.lab-select:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(37, 109, 90, 0.72);
    box-shadow: 0 0 0 4px rgba(37, 109, 90, 0.1), 0 12px 24px rgba(63, 48, 29, 0.08);
}

.lab-select:disabled,
.form-select:disabled {
    color: rgba(118, 111, 102, 0.78);
    background-color: rgba(239, 228, 210, 0.62);
    cursor: not-allowed;
    opacity: 1;
}

.lab-select option,
.form-select option {
    color: var(--lab-ink);
    background: var(--lab-surface);
    font-weight: 700;
}

.cage-list {
    overflow: auto;
    padding: 12px;
    scrollbar-gutter: stable;
}

.cage-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    padding: 20px;
}

.cage-card {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(222, 213, 199, 0.9);
    background: rgba(255, 255, 255, 0.56);
    border-radius: 22px;
    padding: 14px;
    margin-bottom: 10px;
    color: var(--lab-ink);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.cage-card:hover {
    transform: translateY(-2px);
    background: #fffdf8;
    border-color: rgba(37, 109, 90, 0.32);
}

.cage-card.active {
    background: #fffaf0;
    border-color: var(--lab-green);
    box-shadow: 0 14px 28px rgba(37, 109, 90, 0.14);
}

.cage-summary-card {
    display: flex;
    flex-direction: column;
    min-height: 460px;
    margin: 0;
    padding: 18px;
    background:
        linear-gradient(150deg, rgba(255, 250, 240, 0.92), rgba(255, 255, 255, 0.56)),
        radial-gradient(circle at 100% 0%, rgba(37, 109, 90, 0.08), transparent 17rem);
    content-visibility: auto;
    contain-intrinsic-size: 460px;
}

.cage-summary-card:hover {
    box-shadow: 0 18px 38px rgba(63, 48, 29, 0.12);
}

.cage-summary-no {
    font-size: 1.86rem;
}

.cage-summary-head-stats {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.cage-established-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(216, 138, 45, 0.28);
    border-radius: 999px;
    padding: 0.34rem 0.72rem;
    background: rgba(216, 138, 45, 0.12);
    color: #955713;
    font-family: var(--lab-mono);
    font-size: 0.84rem;
    font-weight: 900;
    white-space: nowrap;
}

.cage-summary-stats {
    margin-top: 14px;
}

.cage-summary-section {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(222, 213, 199, 0.78);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.54);
}

.summary-section-title {
    margin-bottom: 8px;
    color: var(--lab-green);
    font-family: var(--lab-mono);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.summary-empty,
.summary-more {
    color: var(--lab-muted);
    font-size: 0.78rem;
}

.summary-more {
    margin-top: 8px;
    font-weight: 800;
}

.cage-member-preview-list,
.cage-litter-preview-list {
    display: grid;
    gap: 8px;
}

.cage-member-preview,
.cage-litter-preview {
    padding: 9px;
    border: 1px solid rgba(222, 213, 199, 0.72);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.48);
}

.member-preview-main {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    min-width: 0;
    flex-wrap: wrap;
}

.member-preview-id {
    min-width: 0;
    overflow: hidden;
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.74rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-preview-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.cage-litter-preview {
    display: grid;
    gap: 8px;
}

.cage-litter-preview strong {
    font-family: var(--lab-mono);
    font-size: 0.86rem;
}

.cage-litter-preview span {
    color: var(--lab-muted);
    font-size: 0.76rem;
}

.litter-preview-counts {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.litter-preview-counts span {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(239, 228, 210, 0.72);
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.66rem;
    font-weight: 900;
}

.source-preview-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mouse-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mouse-detail-field,
.mouse-detail-note {
    padding: 12px;
    border: 1px solid rgba(222, 213, 199, 0.86);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.62);
}

.mouse-detail-field span,
.mouse-detail-note span {
    display: block;
    margin-bottom: 6px;
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mouse-detail-field strong {
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-size: 0.94rem;
}

.mouse-detail-note {
    margin-top: 10px;
}

.mouse-detail-note p {
    margin: 0;
    color: var(--lab-ink);
}

.mouse-detail-history {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.mouse-detail-history section {
    padding: 12px;
    border: 1px solid rgba(222, 213, 199, 0.86);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.42);
}

.mouse-history-list {
    display: grid;
    gap: 8px;
}

.mouse-history-item {
    display: grid;
    gap: 3px;
    padding: 9px;
    border-radius: 14px;
    background: rgba(239, 228, 210, 0.54);
}

.mouse-history-item strong {
    font-family: var(--lab-mono);
    font-size: 0.78rem;
}

.mouse-history-item span,
.mouse-history-item em,
.mouse-history-item small {
    color: var(--lab-muted);
    font-size: 0.76rem;
    font-style: normal;
}

.mouse-history-item small {
    line-height: 1.45;
}

.mouse-flow-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.mouse-flow-summary > div {
    padding: 12px;
    border: 1px solid rgba(222, 213, 199, 0.86);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.68);
}

.mouse-flow-summary span {
    display: block;
    margin-bottom: 6px;
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mouse-flow-summary strong {
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-size: 0.92rem;
}

.mouse-flow-timeline {
    position: relative;
    display: grid;
    gap: 14px;
    padding-left: 18px;
}

.mouse-flow-timeline::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 17px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(93, 135, 255, 0.48), rgba(120, 86, 55, 0.26));
}

.mouse-flow-item {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.mouse-flow-index {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(93, 135, 255, 0.35);
    border-radius: 999px;
    background: linear-gradient(135deg, #fffdf8, #ecf1ff);
    color: #425071;
    font-family: var(--lab-mono);
    font-size: 0.78rem;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(50, 38, 26, 0.08);
}

.mouse-flow-card {
    padding: 13px 14px;
    border: 1px solid rgba(222, 213, 199, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 26px rgba(50, 38, 26, 0.07);
}

.mouse-flow-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.mouse-flow-card-head strong {
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-size: 0.86rem;
}

.mouse-flow-card-head span {
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.76rem;
    white-space: nowrap;
}

.mouse-flow-route {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.mouse-flow-route span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(239, 228, 210, 0.72);
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-size: 0.82rem;
    font-weight: 800;
}

.mouse-flow-route i {
    color: var(--lab-muted);
    font-style: normal;
    font-weight: 900;
}

.mouse-flow-card p {
    margin: 0;
    color: var(--lab-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.cage-card-enter {
    margin-top: auto;
    padding-top: 14px;
    color: var(--lab-green);
    font-size: 0.82rem;
    font-weight: 900;
}

.cage-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cage-no {
    font-family: var(--lab-mono);
    font-size: 1.28rem;
    font-weight: 900;
}

.cage-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.cage-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.mini-stat {
    background: rgba(239, 228, 210, 0.62);
    border-radius: 14px;
    padding: 8px;
}

.mini-stat strong {
    display: block;
    font-family: var(--lab-mono);
    line-height: 1;
}

.mini-stat span {
    color: var(--lab-muted);
    font-size: 0.72rem;
}

.detail-panel {
    min-height: 640px;
    overflow: hidden;
}

.detail-empty {
    min-height: 640px;
    display: grid;
    place-items: center;
    padding: 40px;
    color: var(--lab-muted);
    text-align: center;
}

.detail-header {
    position: relative;
    padding: 26px;
    border-bottom: 1px solid var(--lab-line);
    background: linear-gradient(135deg, rgba(255, 250, 240, 0.92), rgba(239, 228, 210, 0.64));
}

.detail-title-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.detail-cage-no {
    font-family: var(--lab-mono);
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.08em;
}

.detail-subline {
    margin-top: 12px;
    color: var(--lab-muted);
}

.detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.detail-body {
    padding: 20px;
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.lab-section {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(222, 213, 199, 0.85);
    border-radius: 22px;
    padding: 16px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.section-heading h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 900;
}

.mouse-stack,
.litter-stack {
    display: grid;
    gap: 10px;
}

.member-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.member-stack .mouse-chip {
    align-content: center;
    min-height: 92px;
}

.mouse-chip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(222, 213, 199, 0.9);
    border-radius: 18px;
    padding: 10px;
    background: rgba(255, 250, 240, 0.78);
}

.mouse-id {
    font-family: var(--lab-mono);
    font-weight: 900;
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mouse-note {
    color: var(--lab-muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.litter-card {
    border: 1px solid rgba(222, 213, 199, 0.9);
    border-radius: 20px;
    padding: 14px;
    background: rgba(255, 250, 240, 0.74);
}

.breeder-picker-search {
    margin-bottom: 14px;
}

.breeder-capacity-panel {
    margin-bottom: 14px;
}

.breeder-source-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 5px;
    border: 1px solid rgba(222, 213, 199, 0.86);
    border-radius: 999px;
    background: rgba(255, 250, 240, 0.62);
}

.breeder-source-tab {
    border: 0;
    border-radius: 999px;
    padding: 7px 13px;
    background: transparent;
    color: var(--lab-muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.breeder-source-tab.is-active {
    background: var(--lab-green);
    color: #fffaf0;
    box-shadow: 0 8px 18px rgba(37, 109, 90, 0.18);
}

.breeder-capacity-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.breeder-rule-copy {
    margin-top: 8px;
    color: var(--lab-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.breeder-cage-list {
    display: grid;
    gap: 12px;
    max-height: min(58vh, 620px);
    overflow: auto;
    padding-right: 4px;
}

.new-cage-breeder-panel {
    margin-bottom: 1rem;
    border: 1px solid rgba(222, 213, 199, 0.86);
    border-radius: 22px;
    padding: 14px;
    background: rgba(255, 250, 240, 0.58);
}

.breeder-cage-list-embedded {
    max-height: min(42vh, 430px);
}

.new-cage-breeder-panel .breeder-capacity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nursery-offspring-litter-list,
.nursery-offspring-litter {
    display: grid;
    gap: 10px;
}

.nursery-offspring-litter {
    padding: 0 14px 14px;
}

.breeder-cage-card {
    border: 1px solid rgba(222, 213, 199, 0.94);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(255, 250, 240, 0.9), rgba(255, 255, 255, 0.56)),
        radial-gradient(circle at 100% 0%, rgba(37, 109, 90, 0.07), transparent 16rem);
    overflow: hidden;
}

.breeder-cage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.breeder-cage-head::-webkit-details-marker {
    display: none;
}

.breeder-cage-head::after {
    content: '展开';
    color: var(--lab-muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.breeder-cage-card[open] .breeder-cage-head::after {
    content: '收起';
}

.breeder-cage-no {
    font-family: var(--lab-mono);
    font-size: 1.08rem;
    font-weight: 900;
}

.breeder-cage-meta {
    color: var(--lab-muted);
    font-size: 0.82rem;
}

.breeder-cage-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.breeder-mouse-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    padding: 0 14px 14px;
}

.breeder-mouse-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(37, 109, 90, 0.13);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
}

.breeder-mouse-option:hover {
    border-color: rgba(37, 109, 90, 0.32);
    background: rgba(255, 250, 240, 0.88);
}

.breeder-mouse-option input {
    margin-top: 5px;
    accent-color: var(--lab-green-dark);
}

.breeder-mouse-option.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.breeder-mouse-option.is-disabled:hover {
    border-color: rgba(37, 109, 90, 0.13);
    background: rgba(255, 255, 255, 0.55);
}

.breeder-mouse-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.breeder-mouse-main strong {
    font-family: var(--lab-mono);
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breeder-mouse-main em,
.breeder-mouse-main small {
    color: var(--lab-muted);
    font-style: normal;
    font-size: 0.78rem;
}

.breeder-disabled-reason {
    width: fit-content;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(118, 111, 102, 0.12);
    color: var(--lab-muted);
    font-size: 0.72rem;
    font-weight: 900;
}

.breeder-selected-summary {
    margin-right: auto;
    color: var(--lab-green-dark);
    font-family: var(--lab-mono);
    font-weight: 900;
}

.litter-card-expanded {
    background:
        linear-gradient(135deg, rgba(255, 250, 240, 0.92), rgba(255, 255, 255, 0.58)),
        radial-gradient(circle at 100% 0%, rgba(37, 109, 90, 0.07), transparent 14rem);
}

.litter-card.is-closed {
    opacity: 0.62;
    filter: grayscale(0.34);
    background: rgba(245, 241, 233, 0.78);
}

.litter-card.is-closed .geno-bar {
    opacity: 0.78;
}

.litter-card.is-closed.is-expanded {
    opacity: 0.82;
    filter: grayscale(0.16);
}

.closed-litter-summary {
    margin-top: 12px;
    border: 1px dashed rgba(118, 111, 102, 0.3);
    border-radius: 16px;
    padding: 10px 12px;
    color: var(--lab-muted);
    font-size: 0.82rem;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.36);
}

.litter-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.litter-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.litter-name {
    font-family: var(--lab-mono);
    font-size: 1.05rem;
    font-weight: 900;
}

.litter-dob {
    color: var(--lab-muted);
    font-size: 0.83rem;
}

.geno-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.geno-pill {
    border-radius: 14px;
    padding: 8px;
    background: rgba(239, 228, 210, 0.65);
    font-family: var(--lab-mono);
    font-weight: 800;
    font-size: 0.76rem;
    text-align: center;
    white-space: nowrap;
}

.litter-filterbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(37, 109, 90, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
}

.litter-filter-copy {
    color: var(--lab-muted);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.litter-filter-copy span {
    margin-left: 6px;
    color: var(--lab-green-dark);
    font-family: var(--lab-mono);
}

.litter-filter-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.litter-filterbar .filter-pill {
    font-size: 0.78rem;
}

.litter-filterbar .filter-pill .form-select {
    min-width: 122px;
    min-height: 34px;
    padding-top: 0.28rem;
    padding-bottom: 0.28rem;
    font-size: 0.78rem;
}

.litter-mice {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tiny-mouse {
    border: 1px solid rgba(222, 213, 199, 0.95);
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.6);
    font-family: var(--lab-mono);
    font-size: 0.72rem;
}

.litter-offspring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
    margin-top: 12px;
    transition: opacity 0.16s ease, transform 0.16s ease, filter 0.16s ease;
}

.litter-batchbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: 2px;
}

.litter-batch-count {
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.78rem;
    font-weight: 800;
}

.litter-offspring-grid.is-filtering {
    opacity: 0.55;
    transform: translateY(2px);
    filter: blur(1px);
}

.litter-offspring-grid.is-filtered {
    opacity: 1;
    transform: translateY(0);
    filter: none;
}

.offspring-token {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border: 1px solid rgba(222, 213, 199, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
}

.offspring-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.offspring-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--lab-green);
}

.offspring-token-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.offspring-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.offspring-actions .btn {
    padding: 0.42rem 0.88rem;
    font-size: 0.9rem;
    line-height: 1.1;
}

.offspring-nursery-panel {
    margin: 14px 0;
    padding: 12px;
    border: 1px solid rgba(37, 109, 90, 0.16);
    border-radius: 20px;
    background: rgba(37, 109, 90, 0.06);
}

.nursery-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.offspring-nursery-options {
    display: grid;
    gap: 8px;
}

.offspring-nursery-option,
.offspring-nursery-auto {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(222, 213, 199, 0.86);
    border-radius: 16px;
    background: rgba(255, 250, 240, 0.7);
}

.offspring-nursery-option input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--lab-green);
}

.offspring-nursery-option > span {
    display: grid;
    gap: 3px;
}

.offspring-nursery-option strong,
.offspring-nursery-auto strong {
    color: var(--lab-green-dark);
    font-family: var(--lab-mono);
    font-weight: 950;
}

.offspring-nursery-option em,
.offspring-nursery-auto span {
    color: var(--lab-muted);
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 800;
}

.offspring-nursery-option.is-disabled {
    opacity: 0.55;
}

.offspring-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(37, 109, 90, 0.12);
    color: var(--lab-green-dark);
    font-family: var(--lab-mono);
    font-size: 1.12rem;
    font-weight: 900;
}

.offspring-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

.offspring-meta .lab-badge {
    flex: 0 0 auto;
    padding: 0.32rem 0.68rem;
    font-size: 0.82rem;
}

.lab-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 0.24rem 0.58rem;
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1;
}

.badge-breeding { background: rgba(37, 109, 90, 0.13); color: var(--lab-green); }
.badge-nursery { background: rgba(61, 115, 168, 0.13); color: var(--lab-blue); }
.badge-active { background: rgba(37, 109, 90, 0.13); color: var(--lab-green); }
.badge-closed, .badge-retired { background: rgba(118, 111, 102, 0.16); color: var(--lab-muted); }
.badge-male { background: rgba(61, 115, 168, 0.16); color: var(--lab-blue); }
.badge-female { background: rgba(182, 91, 138, 0.16); color: var(--lab-pink); }
.badge-wt { background: rgba(86, 108, 130, 0.16); color: #48606f; }
.badge-het { background: rgba(216, 138, 45, 0.17); color: #955713; }
.badge-hom { background: rgba(185, 74, 72, 0.16); color: var(--lab-red); }
.badge-unknown { background: rgba(118, 111, 102, 0.13); color: var(--lab-muted); }
.badge-warning { background: rgba(216, 138, 45, 0.17); color: #955713; }
.badge-danger { background: rgba(185, 74, 72, 0.16); color: var(--lab-red); }

.toast-zone {
    position: fixed;
    right: 20px;
    top: 76px;
    z-index: 1080;
    display: grid;
    gap: 10px;
}

.lab-toast {
    min-width: 260px;
    max-width: 360px;
    padding: 12px 14px;
    border: 1px solid var(--lab-line);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.96);
    box-shadow: var(--lab-shadow);
    color: var(--lab-ink);
    font-weight: 700;
}

.lab-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(36, 33, 29, 0.26);
    opacity: 0;
    transition: opacity 0.16s ease;
}

.lab-confirm-backdrop.is-visible {
    opacity: 1;
}

.lab-confirm-backdrop.is-leaving {
    opacity: 0;
}

.lab-confirm-card {
    width: min(460px, 100%);
    padding: 22px;
    border: 1px solid var(--lab-line);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255, 250, 240, 0.98), rgba(251, 243, 227, 0.96));
    box-shadow: 0 28px 80px rgba(36, 33, 29, 0.28);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.16s ease;
}

.lab-confirm-backdrop.is-visible .lab-confirm-card {
    transform: translateY(0) scale(1);
}

.lab-confirm-eyebrow {
    margin-bottom: 8px;
    color: var(--lab-green);
    font-family: var(--lab-mono);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.lab-confirm-danger .lab-confirm-eyebrow {
    color: var(--lab-red);
}

.lab-confirm-title {
    margin: 0;
    color: var(--lab-ink);
    font-size: 1.28rem;
    font-weight: 950;
}

.lab-confirm-message {
    margin: 12px 0 0;
    color: var(--lab-muted);
    line-height: 1.65;
}

.lab-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.empty-card {
    padding: 18px;
    border: 1px dashed rgba(118, 111, 102, 0.34);
    border-radius: 18px;
    color: var(--lab-muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.34);
}

.data-panel {
    min-height: clamp(420px, 54vh, 720px);
    transition: opacity 0.22s ease, transform 0.22s ease, filter 0.22s ease;
}

.data-panel.is-pending {
    min-height: 0;
    height: 0;
    margin: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(10px);
}

.data-panel.is-ready {
    animation: data-panel-in 0.24s ease-out both;
}

.data-panel.is-refreshing {
    opacity: 0.68;
    filter: saturate(0.92);
}

.identity-grid {
    display: grid;
    gap: 14px;
    min-height: clamp(320px, 42vh, 600px);
}

.identity-grid.is-box-view {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
}

.identity-grid.is-list-view {
    grid-template-columns: 1fr;
}

.identity-heading-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.identity-view-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(222, 213, 199, 0.92);
    border-radius: 999px;
    background: rgba(255, 250, 240, 0.72);
}

.identity-view-btn {
    border: 0;
    border-radius: 999px;
    padding: 5px 11px;
    background: transparent;
    color: var(--lab-muted);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.identity-view-btn.is-active {
    background: var(--lab-green);
    color: #fffaf0;
    box-shadow: 0 6px 16px rgba(37, 109, 90, 0.18);
}

.identity-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(222, 213, 199, 0.92);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 250, 240, 0.92), rgba(255, 255, 255, 0.48)),
        radial-gradient(circle at 0% 0%, rgba(37, 109, 90, 0.07), transparent 22rem);
    box-shadow: 0 10px 26px rgba(63, 48, 29, 0.07);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.identity-role-marker {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 250, 240, 0.72);
    border-radius: 999px;
    color: #fffaf0;
    font-size: 0.76rem;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(63, 48, 29, 0.14);
}

.identity-role-marker.is-breeder {
    background: linear-gradient(135deg, var(--lab-green), var(--lab-green-dark));
}

.identity-role-marker.is-offspring {
    background: linear-gradient(135deg, #d88a2d, #9f5d1b);
}

.identity-role-marker.is-candidate {
    background: linear-gradient(135deg, #8b6fcb, #5e4a9a);
}

.identity-role-marker.is-purchased {
    background: linear-gradient(135deg, #7f8a95, #4f5b66);
}

.identity-role-marker.is-archived {
    background: linear-gradient(135deg, #9a9489, #665f55);
}

.identity-grid.is-box-view .identity-card {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: stretch;
    padding: 15px;
    border-radius: 22px;
}

.identity-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 109, 90, 0.34);
    box-shadow: 0 16px 34px rgba(63, 48, 29, 0.11);
}

.identity-kicker {
    color: var(--lab-green);
    font-family: var(--lab-mono);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.identity-current-cage {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 5px 8px;
    border: 1px solid rgba(37, 109, 90, 0.18);
    border-radius: 999px;
    background: rgba(37, 109, 90, 0.08);
    font-family: var(--lab-sans);
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: none;
}

.identity-current-cage span {
    color: var(--lab-muted);
    font-weight: 800;
}

.identity-current-cage strong {
    color: var(--lab-green-dark);
    font-family: var(--lab-mono);
    font-size: 0.94rem;
    font-weight: 900;
}

.identity-title {
    margin-top: 4px;
    font-family: var(--lab-mono);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--lab-ink);
}

.identity-fields {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-top: 9px;
    flex-wrap: wrap;
}

.identity-field {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    padding: 0;
}

.identity-field span {
    display: inline;
    margin-bottom: 0;
    color: var(--lab-ink);
    font-size: 0.72rem;
    font-weight: 950;
    line-height: 1.1;
}

.identity-field strong {
    display: inline-block;
    overflow: hidden;
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-size: 1.04rem;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.identity-rule {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid rgba(37, 109, 90, 0.18);
    border-radius: 999px;
    background: rgba(37, 109, 90, 0.08);
    color: var(--lab-green-dark);
    font-family: var(--lab-mono);
    font-size: 0.92em;
    font-weight: 900;
    white-space: nowrap;
}

.identity-rule-line {
    padding-top: 8px;
}

.identity-subtitle {
    margin-top: 5px;
    color: var(--lab-muted);
    font-size: 0.86rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.identity-grid.is-box-view .identity-title {
    font-size: 0.96rem;
}

.identity-grid.is-box-view .identity-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.identity-grid.is-box-view .identity-field {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 0;
}

.identity-grid.is-box-view .identity-field span {
    margin-bottom: 0;
    flex: 0 0 auto;
    font-size: 0.72rem;
}

.identity-grid.is-box-view .identity-field strong {
    font-size: 0.96rem;
    text-align: left;
}

.identity-grid.is-box-view .identity-subtitle {
    font-size: 0.84rem;
}

.identity-badges,
.identity-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.identity-grid.is-box-view .identity-badges,
.identity-grid.is-box-view .identity-actions {
    justify-content: flex-start;
}

.identity-grid.is-box-view .identity-actions .btn {
    flex: 1 1 auto;
    padding-right: 8px;
    padding-left: 8px;
}

.event-board {
    display: grid;
    gap: 16px;
    min-height: clamp(360px, 46vh, 640px);
}

.event-group {
    padding: 16px;
    border: 1px solid rgba(222, 213, 199, 0.92);
    border-radius: 26px;
    background: rgba(255, 250, 240, 0.62);
}

.event-group-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.event-group-header h3 {
    margin: 4px 0 0;
    font-family: var(--lab-mono);
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.event-group-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.event-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.event-card {
    padding: 14px;
    border: 1px solid rgba(222, 213, 199, 0.88);
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.62), rgba(251, 243, 227, 0.72)),
        radial-gradient(circle at 100% 0%, rgba(216, 138, 45, 0.11), transparent 16rem);
    box-shadow: 0 8px 20px rgba(63, 48, 29, 0.06);
}

.event-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.event-title {
    font-family: var(--lab-mono);
    font-size: 1.12rem;
    font-weight: 900;
}

.event-date {
    margin-top: 3px;
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.76rem;
}

.event-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.event-metric {
    padding: 9px 8px;
    border-radius: 16px;
    background: rgba(239, 228, 210, 0.68);
    text-align: center;
}

.event-metric strong {
    display: block;
    font-family: var(--lab-mono);
    font-size: 1.02rem;
    line-height: 1;
}

.event-metric span {
    display: block;
    margin-top: 4px;
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.66rem;
    font-weight: 800;
}

.event-metric.wt { background: rgba(86, 108, 130, 0.13); }
.event-metric.het { background: rgba(216, 138, 45, 0.16); }
.event-metric.hom { background: rgba(185, 74, 72, 0.14); }

.event-status-board {
    display: grid;
    gap: 9px;
    margin-top: 13px;
}

.event-status-group {
    padding: 10px;
    border: 1px solid rgba(222, 213, 199, 0.76);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.58);
}

.event-status-group.status-growing {
    border-color: rgba(37, 109, 90, 0.16);
    background: rgba(37, 109, 90, 0.07);
}

.event-status-group.status-pending_breeding {
    border-color: rgba(216, 138, 45, 0.24);
    background: rgba(216, 138, 45, 0.09);
}

.event-status-group.status-breeding {
    border-color: rgba(37, 109, 90, 0.26);
    background: rgba(37, 109, 90, 0.11);
}

.event-status-group.status-sampled,
.event-status-group.status-euthanized {
    border-color: rgba(118, 111, 102, 0.2);
    background: rgba(118, 111, 102, 0.08);
}

.event-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.event-status-head span {
    color: var(--lab-ink);
    font-size: 0.78rem;
    font-weight: 950;
}

.event-status-head strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--lab-green-dark);
    font-family: var(--lab-mono);
    font-size: 0.82rem;
    font-weight: 950;
}

.event-mouse-tokens {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.event-mouse-token {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(222, 213, 199, 0.82);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--lab-ink);
    max-width: 100%;
}

.event-mouse-token strong {
    font-family: var(--lab-mono);
    font-size: 0.84rem;
    font-weight: 950;
}

.event-mouse-token em {
    color: var(--lab-muted);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
}

.event-sex-mark {
    font-weight: 950;
}

.event-sex-mark.is-male {
    color: var(--lab-blue);
}

.event-sex-mark.is-female {
    color: var(--lab-pink);
}

.event-sex-mark.is-unknown {
    color: var(--lab-muted);
}

.event-mouse-token.genotype-wt { border-color: rgba(86, 108, 130, 0.22); }
.event-mouse-token.genotype-het { border-color: rgba(216, 138, 45, 0.32); }
.event-mouse-token.genotype-hom { border-color: rgba(185, 74, 72, 0.28); }

.event-status-empty {
    margin-top: 13px;
    padding: 10px;
    border: 1px dashed rgba(118, 111, 102, 0.28);
    border-radius: 16px;
    color: var(--lab-muted);
    font-size: 0.82rem;
    text-align: center;
}

@keyframes data-panel-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lab-page-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lab-section-enter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.992);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.event-note {
    margin-top: 12px;
    color: var(--lab-muted);
    font-size: 0.84rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.schedule-summary .metric-card:nth-child(1) .metric-value { color: var(--lab-red); }
.schedule-summary .metric-card:nth-child(2) .metric-value { color: var(--lab-green); }
.schedule-summary .metric-card:nth-child(3) .metric-value { color: var(--lab-amber); }
.schedule-summary .metric-card:nth-child(4) .metric-value { color: var(--lab-blue); }

.schedule-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.schedule-calendar-panel,
.schedule-detail-panel {
    padding: 18px;
}

.schedule-month-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(222, 213, 199, 0.88);
    border-radius: 999px;
    background: rgba(255, 250, 240, 0.72);
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-size: 0.92rem;
    font-weight: 950;
    box-shadow: 0 8px 18px rgba(63, 48, 29, 0.06);
}

.schedule-weekdays,
.schedule-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.schedule-weekdays {
    margin-bottom: 8px;
}

.schedule-weekdays span {
    color: var(--lab-muted);
    font-size: 0.74rem;
    font-weight: 950;
    text-align: center;
}

.schedule-day {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 118px;
    padding: 10px;
    border: 1px solid rgba(222, 213, 199, 0.88);
    border-radius: 20px;
    background: rgba(255, 250, 240, 0.68);
    color: var(--lab-ink);
    text-align: left;
    box-shadow: 0 8px 18px rgba(63, 48, 29, 0.05);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.schedule-day:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 109, 90, 0.3);
    box-shadow: 0 14px 28px rgba(63, 48, 29, 0.1);
}

.schedule-day.is-adjacent-month {
    opacity: 0.48;
}

.schedule-day.is-selected {
    border-color: rgba(37, 109, 90, 0.52);
    background: linear-gradient(145deg, rgba(37, 109, 90, 0.11), rgba(255, 250, 240, 0.82)), var(--lab-surface);
    box-shadow: 0 16px 32px rgba(37, 109, 90, 0.12);
}

.schedule-day.is-today::after {
    content: "今天";
    position: absolute;
    top: 9px;
    right: 9px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--lab-green);
    color: #fffaf0;
    font-size: 0.62rem;
    font-weight: 950;
}

.schedule-day.has-overdue {
    border-color: rgba(185, 74, 72, 0.38);
}

.schedule-day.is-all-done {
    border-color: rgba(37, 109, 90, 0.18);
    background: rgba(37, 109, 90, 0.06);
}

.schedule-day-number {
    font-family: var(--lab-mono);
    font-size: 1.1rem;
    font-weight: 950;
    line-height: 1;
}

.schedule-day-events {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.schedule-day-events em {
    color: var(--lab-muted);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
}

.schedule-chip,
.schedule-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    max-width: 100%;
    padding: 5px 7px;
    border: 1px solid rgba(222, 213, 199, 0.72);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    color: var(--lab-ink);
    font-size: 0.68rem;
    font-weight: 950;
    line-height: 1;
}

.schedule-chip strong {
    font-family: var(--lab-mono);
    font-size: 0.72rem;
}

.schedule-chip.is-done {
    border-color: rgba(37, 109, 90, 0.18);
    background: rgba(37, 109, 90, 0.09);
    color: var(--lab-green-dark);
}

.schedule-chip.is-ignored {
    border-color: rgba(118, 111, 102, 0.18);
    background: rgba(118, 111, 102, 0.08);
    color: var(--lab-muted);
}

.schedule-chip.type-nail,
.schedule-type-pill.type-nail,
.schedule-chip.type-male_mature,
.schedule-type-pill.type-male_mature {
    border-color: rgba(61, 115, 168, 0.22);
    background: rgba(61, 115, 168, 0.12);
    color: var(--lab-blue);
}

.schedule-chip.type-sample_wean,
.schedule-type-pill.type-sample_wean,
.schedule-chip.type-female_mature,
.schedule-type-pill.type-female_mature {
    border-color: rgba(182, 91, 138, 0.22);
    background: rgba(182, 91, 138, 0.12);
    color: var(--lab-pink);
}

.schedule-chip.type-custom,
.schedule-type-pill.type-custom {
    border-color: rgba(37, 109, 90, 0.22);
    background: rgba(37, 109, 90, 0.12);
    color: var(--lab-green-dark);
}

.schedule-chip-text {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-add-btn {
    width: 100%;
}

.schedule-detail-list {
    display: grid;
    gap: 12px;
}

.schedule-detail-card {
    padding: 14px;
    border: 1px solid rgba(222, 213, 199, 0.86);
    border-radius: 22px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.64), rgba(251, 243, 227, 0.74)), radial-gradient(circle at 100% 0%, rgba(37, 109, 90, 0.08), transparent 15rem);
    box-shadow: 0 9px 22px rgba(63, 48, 29, 0.07);
}

.schedule-detail-card.timing-overdue {
    border-color: rgba(185, 74, 72, 0.35);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.62), rgba(251, 243, 227, 0.72)), radial-gradient(circle at 100% 0%, rgba(185, 74, 72, 0.11), transparent 15rem);
}

.schedule-detail-card.timing-today {
    border-color: rgba(37, 109, 90, 0.36);
}

.schedule-detail-card.is-done,
.schedule-detail-card.is-ignored {
    border-color: rgba(37, 109, 90, 0.18);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.5), rgba(239, 228, 210, 0.5));
    opacity: 0.72;
}

.schedule-detail-card.is-ignored {
    border-color: rgba(118, 111, 102, 0.24);
}

.schedule-detail-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.schedule-detail-top .identity-kicker {
    width: fit-content;
    padding: 4px 8px;
    border: 1px solid rgba(37, 109, 90, 0.16);
    border-radius: 999px;
    background: rgba(37, 109, 90, 0.08);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    line-height: 1;
}

.schedule-detail-top h4 {
    margin: 3px 0 0;
    font-family: var(--lab-mono);
    font-size: 1rem;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.schedule-user-title {
    display: -webkit-box;
    max-width: 22rem;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.schedule-user-notes {
    margin-top: 10px;
    color: var(--lab-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.schedule-detail-badges {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.schedule-age-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(216, 138, 45, 0.32);
    border-radius: 999px;
    padding: 5px 9px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(216, 138, 45, 0.14));
    color: var(--lab-amber);
    font-family: var(--lab-mono);
    font-size: 0.72rem;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(216, 138, 45, 0.12);
}

.schedule-detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.schedule-detail-meta span {
    padding: 5px 8px;
    border: 1px solid rgba(222, 213, 199, 0.78);
    border-radius: 999px;
    background: rgba(255, 250, 240, 0.62);
    color: var(--lab-muted);
    font-size: 0.72rem;
    font-weight: 850;
}

.schedule-detail-meta strong {
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-weight: 950;
}

.schedule-mouse-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.schedule-mouse-token {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(222, 213, 199, 0.82);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.64);
}

.schedule-mouse-token strong {
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-size: 0.84rem;
    font-weight: 950;
}

.schedule-mouse-token em {
    color: var(--lab-muted);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
}

.schedule-mouse-token.genotype-wt { border-color: rgba(86, 108, 130, 0.22); }
.schedule-mouse-token.genotype-het { border-color: rgba(216, 138, 45, 0.32); }
.schedule-mouse-token.genotype-hom { border-color: rgba(185, 74, 72, 0.28); }

.schedule-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.schedule-action-state {
    margin-right: auto;
    color: var(--lab-green-dark);
    font-size: 0.78rem;
    font-weight: 950;
}

.schedule-detail-card.is-ignored .schedule-action-state {
    color: var(--lab-muted);
}

.form-control,
.form-select {
    border-color: var(--lab-line);
    border-radius: 14px;
}

.lab-check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(222, 213, 199, 0.92);
    border-radius: 999px;
    background: rgba(255, 250, 240, 0.72);
    color: var(--lab-ink);
    font-weight: 900;
}

.lab-check-row input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--lab-green);
}

.lab-date-input {
    padding-right: 2.65rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23256d5a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3Cpath d='M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01'/%3E%3C/svg%3E");
    background-position: calc(100% - 1rem) 50%;
    background-size: 1.05rem 1.05rem;
    background-repeat: no-repeat;
    cursor: pointer;
}

.flatpickr-calendar.lab-calendar {
    width: 318px;
    padding: 12px;
    border: 1px solid rgba(222, 213, 199, 0.96);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(255, 250, 240, 0.98), rgba(251, 243, 227, 0.96)),
        radial-gradient(circle at 100% 0%, rgba(37, 109, 90, 0.12), transparent 12rem);
    box-shadow: 0 22px 54px rgba(63, 48, 29, 0.2);
    color: var(--lab-ink);
    font-family: var(--lab-sans);
}

.flatpickr-calendar.lab-calendar::before,
.flatpickr-calendar.lab-calendar::after {
    display: none;
}

.flatpickr-calendar.lab-calendar .flatpickr-months {
    align-items: center;
    padding: 2px 2px 8px;
}

.flatpickr-calendar.lab-calendar .flatpickr-month {
    height: 38px;
    color: var(--lab-ink);
}

.flatpickr-calendar.lab-calendar .flatpickr-current-month {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0;
    font-size: 1rem;
    font-weight: 900;
}

.flatpickr-calendar.lab-calendar .flatpickr-current-month .numInputWrapper {
    width: 5.2rem;
}

.flatpickr-calendar.lab-calendar .flatpickr-current-month input.cur-year,
.flatpickr-calendar.lab-calendar .flatpickr-current-month .flatpickr-monthDropdown-months {
    height: 30px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.36);
    color: var(--lab-ink);
    font-weight: 900;
}

.flatpickr-calendar.lab-calendar .flatpickr-prev-month,
.flatpickr-calendar.lab-calendar .flatpickr-next-month {
    top: 12px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    color: var(--lab-green);
}

.flatpickr-calendar.lab-calendar .flatpickr-prev-month:hover,
.flatpickr-calendar.lab-calendar .flatpickr-next-month:hover {
    background: rgba(37, 109, 90, 0.1);
    color: var(--lab-green-dark);
}

.flatpickr-calendar.lab-calendar .flatpickr-weekdays {
    height: 32px;
    border-top: 1px solid rgba(222, 213, 199, 0.76);
    border-bottom: 1px solid rgba(222, 213, 199, 0.76);
}

.flatpickr-calendar.lab-calendar span.flatpickr-weekday {
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.7rem;
    font-weight: 900;
}

.flatpickr-calendar.lab-calendar .dayContainer {
    width: 294px;
    min-width: 294px;
    max-width: 294px;
    padding-top: 8px;
}

.flatpickr-calendar.lab-calendar .flatpickr-days,
.flatpickr-calendar.lab-calendar .flatpickr-rContainer {
    width: 294px;
}

.flatpickr-calendar.lab-calendar .flatpickr-day {
    width: 42px;
    max-width: 42px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--lab-ink);
    line-height: 36px;
}

.flatpickr-calendar.lab-calendar .flatpickr-day:hover,
.flatpickr-calendar.lab-calendar .flatpickr-day:focus {
    border-color: rgba(37, 109, 90, 0.18);
    background: rgba(37, 109, 90, 0.08);
}

.flatpickr-calendar.lab-calendar .flatpickr-day.today {
    border-color: rgba(216, 138, 45, 0.52);
    color: var(--lab-amber);
    font-weight: 900;
}

.flatpickr-calendar.lab-calendar .flatpickr-day.selected,
.flatpickr-calendar.lab-calendar .flatpickr-day.startRange,
.flatpickr-calendar.lab-calendar .flatpickr-day.endRange {
    border-color: var(--lab-green);
    background: linear-gradient(180deg, var(--lab-green), var(--lab-green-dark));
    box-shadow: 0 10px 22px rgba(37, 109, 90, 0.26);
    color: #fffaf0;
    font-weight: 900;
}

.flatpickr-calendar.lab-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar.lab-calendar .flatpickr-day.nextMonthDay {
    color: rgba(118, 111, 102, 0.44);
}

.form-select {
    border-radius: 16px;
    color: var(--lab-ink);
}

.lab-filterbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(222, 213, 199, 0.94);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 250, 240, 0.88), rgba(255, 255, 255, 0.5)),
        radial-gradient(circle at 100% 0%, rgba(37, 109, 90, 0.07), transparent 18rem);
    box-shadow: 0 10px 26px rgba(63, 48, 29, 0.07);
}

.filterbar-copy {
    min-width: 150px;
}

.filterbar-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    color: var(--lab-ink);
    font-size: 0.9rem;
    font-weight: 900;
    white-space: nowrap;
}

.filter-pill .form-select {
    width: auto;
    min-width: 154px;
    max-width: 230px;
    min-height: 38px;
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
    padding-left: 0.74rem;
    border-color: rgba(37, 109, 90, 0.16);
    background-color: rgba(255, 250, 240, 0.7);
    font-size: 0.88rem;
    box-shadow: none;
}

.filter-action {
    min-height: 44px;
}

.lab-ui .modal {
    --bs-modal-margin: 1rem;
}

.lab-ui .modal-dialog {
    min-height: calc(100% - var(--bs-modal-margin) * 2);
    display: flex;
    align-items: center;
}

.lab-ui .modal-content {
    border: 1px solid var(--lab-line);
    border-radius: 28px;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 250, 240, 0.98), rgba(251, 243, 227, 0.96));
    background-clip: padding-box;
    box-shadow: 0 28px 80px rgba(36, 33, 29, 0.28);
}

.lab-ui .modal-header,
.lab-ui .modal-footer {
    background: rgba(239, 228, 210, 0.52);
    border-color: var(--lab-line);
}

.lab-ui .modal-header {
    padding: 18px 22px;
}

.lab-ui .modal-body {
    max-height: calc(100vh - 220px);
    overflow: auto;
    padding: 20px 22px;
}

.lab-ui .modal-footer {
    padding: 14px 22px 18px;
}

.lab-ui .modal-backdrop.show {
    opacity: 0.42;
}

@media (max-width: 1100px) {
    .workspace-grid,
    .lab-hero {
        grid-template-columns: 1fr;
    }
    .cage-rail {
        position: static;
        max-height: none;
    }
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .identity-grid.is-box-view {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .schedule-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1900px) {
    .cage-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pedigree-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: stretch;
}

.pedigree-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.pedigree-filterbar .lab-input {
    min-width: min(360px, 100%);
    flex: 1;
}

.pedigree-graph-panel {
    position: relative;
    min-height: 680px;
    overflow: hidden;
    padding: 18px;
}

.pedigree-warning {
    margin-bottom: 12px;
    padding: 11px 14px;
    border: 1px solid rgba(216, 138, 45, 0.34);
    border-radius: 18px;
    background: rgba(216, 138, 45, 0.12);
    color: #684818;
    font-size: 0.92rem;
}

.pedigree-graph {
    min-height: 560px;
    border: 1px solid rgba(222, 213, 199, 0.92);
    border-radius: 26px;
    background:
        radial-gradient(circle at 20% 18%, rgba(37, 109, 90, 0.08), transparent 22rem),
        linear-gradient(135deg, rgba(255, 250, 240, 0.94), rgba(251, 243, 227, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.8);
}

.pedigree-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    color: var(--lab-muted);
    font-size: 0.86rem;
}

.pedigree-legend span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid currentColor;
}

.legend-mouse { color: var(--lab-amber); background: #fff7df; }
.legend-litter { color: var(--lab-green); background: #e9f2ed; }
.legend-cage { color: var(--lab-blue); background: #e8f0f8; }
.legend-source { color: var(--lab-pink); background: #f5e5ec; }

.legend-line {
    display: inline-block;
    width: 26px;
    border-top: 3px solid var(--lab-green);
}

.legend-dashed {
    border-top-style: dashed;
    border-top-color: #a99c8e;
}

.pedigree-detail-panel {
    position: sticky;
    top: 92px;
    min-height: 680px;
    overflow: hidden;
    padding: 24px;
    border: 1px solid rgba(255, 250, 240, 0.78);
    background:
        linear-gradient(155deg, rgba(255, 250, 240, 0.96), rgba(247, 237, 218, 0.92)),
        var(--lab-surface);
    box-shadow: 0 22px 50px rgba(63, 48, 29, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.pedigree-detail-panel::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 18px;
    right: 18px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--lab-green), var(--lab-amber), var(--lab-pink));
}

.pedigree-detail-panel .section-heading {
    align-items: center;
    margin-top: 8px;
    padding: 14px 2px 18px;
    border-bottom: 1px solid rgba(222, 213, 199, 0.78);
}

.pedigree-detail-panel .section-heading h3 {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin: 0;
}

.pedigree-detail-panel .section-heading h3::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, #fffaf0 0 32%, var(--lab-green) 36% 100%);
    box-shadow: 0 0 0 5px rgba(37, 109, 90, 0.12);
}

.pedigree-detail {
    margin-top: 18px;
}

.pedigree-detail .empty-card {
    min-height: 220px;
    display: grid;
    place-items: center;
    padding: 28px;
    border: 1px dashed rgba(37, 109, 90, 0.34);
    border-radius: 26px;
    background:
        radial-gradient(circle at 50% 18%, rgba(37, 109, 90, 0.12), transparent 9rem),
        rgba(255, 250, 240, 0.64);
    color: var(--lab-muted);
    text-align: center;
    font-weight: 700;
}

.pedigree-detail-card {
    display: grid;
    gap: 16px;
}

.pedigree-detail-identity {
    display: grid;
    gap: 7px;
    padding: 16px 18px;
    border: 1px solid rgba(222, 213, 199, 0.82);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(37, 109, 90, 0.1), transparent 56%),
        rgba(255, 250, 240, 0.78);
}

.pedigree-detail-identity span {
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pedigree-detail-identity strong {
    color: var(--lab-green-dark);
    font-family: var(--lab-mono);
    font-size: 1rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.pedigree-detail-section {
    display: grid;
    gap: 10px;
}

.pedigree-detail-section h4 {
    margin: 0;
    color: var(--lab-muted);
    font-family: var(--lab-mono);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pedigree-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pedigree-field {
    display: grid;
    align-content: start;
    gap: 5px;
    min-height: 68px;
    padding: 11px 12px;
    border: 1px solid rgba(222, 213, 199, 0.76);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.72);
}

.pedigree-field span {
    color: var(--lab-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.pedigree-field strong {
    overflow-wrap: anywhere;
    color: var(--lab-ink);
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.25;
}

.pedigree-notes {
    padding: 13px 14px;
    border: 1px solid rgba(222, 213, 199, 0.76);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.72);
    color: var(--lab-ink);
    line-height: 1.6;
}

.pedigree-parent-box {
    display: grid;
    gap: 10px;
}

.pedigree-parent-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 56px;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid rgba(222, 213, 199, 0.76);
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.72);
}

.pedigree-parent-row span,
.pedigree-parent-row em {
    color: var(--lab-muted);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 800;
}

.pedigree-parent-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--lab-ink);
    font-family: var(--lab-mono);
    font-size: 0.84rem;
}

.pedigree-parent-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
}

.pedigree-parent-locked {
    padding: 10px 12px;
    border: 1px solid rgba(37, 109, 90, 0.2);
    border-radius: 16px;
    background: rgba(37, 109, 90, 0.08);
    color: var(--lab-green-dark);
    font-size: 0.86rem;
    font-weight: 800;
}

.pedigree-parent-form {
    display: grid;
    gap: 12px;
}

.pedigree-parent-form label {
    display: grid;
    gap: 6px;
    color: var(--lab-muted);
    font-weight: 800;
}

@media (max-width: 1500px) {
    .cage-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .cage-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pedigree-layout { grid-template-columns: 1fr; }
    .pedigree-detail-panel,
    .pedigree-graph-panel { min-height: 0; }
}

@media (max-width: 720px) {
    .lab-shell { padding: 18px 14px 30px; }
    .metric-grid { grid-template-columns: 1fr; }
    .rail-filters { grid-template-columns: 1fr; }
    .cage-board { grid-template-columns: 1fr; padding: 12px; }
    .cage-summary-card { min-height: 0; }
    .mouse-detail-grid,
    .mouse-detail-history { grid-template-columns: 1fr; }
    .mouse-flow-summary { grid-template-columns: 1fr; }
    .mouse-flow-card-head { flex-direction: column; gap: 4px; }
    .detail-title-row { flex-direction: column; }
    .detail-actions { justify-content: flex-start; }
    .member-stack { grid-template-columns: 1fr; }
    .geno-bar { grid-template-columns: repeat(2, 1fr); }
    .breeder-capacity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .breeder-cage-head { align-items: flex-start; flex-direction: column; }
    .breeder-cage-stats { justify-content: flex-start; }
    .breeder-mouse-list { grid-template-columns: 1fr; }
    .litter-card-head,
    .offspring-token {
        grid-template-columns: 1fr;
    }
    .offspring-actions { justify-content: center; }
    .litter-card-head,
    .litter-card-actions {
        align-items: flex-start;
        justify-content: flex-start;
    }
    .litter-filterbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .litter-filter-controls { width: 100%; justify-content: flex-start; }
    .litter-filterbar .filter-pill { width: 100%; justify-content: space-between; }
    .litter-filterbar .filter-pill .form-select { flex: 1; max-width: none; }
    .litter-batchbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .litter-offspring-grid {
        grid-template-columns: 1fr;
    }
    .identity-card { grid-template-columns: 1fr; }
    .identity-badges,
    .identity-actions { justify-content: flex-start; }
    .identity-grid.is-box-view { grid-template-columns: 1fr; }
    .identity-heading-tools { justify-content: flex-start; }
    .event-metrics { grid-template-columns: repeat(2, 1fr); }
    .schedule-weekdays { display: none; }
    .schedule-calendar { grid-template-columns: 1fr; }
    .schedule-day { min-height: auto; }
    .schedule-day.is-adjacent-month { display: none; }
    .pedigree-graph { min-height: 460px; }
    .pedigree-detail-grid { grid-template-columns: 1fr; }
    .lab-filterbar {
        width: 100%;
        border-radius: 24px;
        align-items: flex-start;
        flex-direction: column;
    }
    .filterbar-copy { padding-left: 6px; }
    .filterbar-controls { width: 100%; justify-content: flex-start; }
    .filter-pill { width: 100%; justify-content: space-between; }
    .filter-pill .form-select { flex: 1; max-width: none; }
    .filter-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    body.lab-ui .lab-shell,
    body.lab-ui .lab-hero,
    body.lab-ui .metric-grid,
    body.lab-ui .lab-filterbar,
    body.lab-ui .lab-panel,
    body.lab-ui .cage-workspace,
    body.lab-ui .schedule-layout,
    body.lab-ui .pedigree-layout,
    .data-panel.is-ready {
        animation: none;
    }

    .lab-nav .nav-link {
        transition: none;
    }
}
