:root {
    --forest: #193e35;
    --forest-2: #2e6654;
    --sage: #89aa92;
    --mint: #dceadf;
    --ivory: #fbfaf4;
    --paper: #fffef9;
    --ink: #19322c;
    --muted: #64766d;
    --line: #d9e1d6;
    --gold: #d7a83e;
    --coral: #ba5b4b;
    --blue: #447b82;
    --shadow: 0 12px 36px rgba(26, 62, 53, 0.08);
    --radius: 18px;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--ink);
    background: var(--ivory);
    font-synthesis: none;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 88% -10%, #e4eee3 0, transparent 35%),
        var(--ivory);
}
button,
input,
select,
textarea {
    font: inherit;
}
button {
    cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(68, 123, 130, 0.38);
    outline-offset: 2px;
}
a {
    color: var(--forest-2);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.noscript {
    max-width: 40rem;
    margin: 8rem auto;
    padding: 2rem;
}
.app-shell {
    min-height: 100vh;
}
.topbar {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem clamp(1rem, 4vw, 4rem);
    background: rgba(255, 254, 249, 0.9);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: 1.24rem;
    color: var(--forest);
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border-radius: 13px;
    color: #fff;
    background: var(--forest);
    font-size: 1.35rem;
    box-shadow: 0 6px 14px rgba(25, 62, 53, 0.2);
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.user-chip {
    font-size: 0.82rem;
    color: var(--muted);
    display: none;
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--forest);
    background: var(--mint);
    font-weight: 800;
}
.app-layout {
    width: min(1280px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 218px 1fr;
    gap: 2.2rem;
    padding: 2rem clamp(1rem, 4vw, 4rem) 4rem;
}
.sidebar {
    padding-top: 0.3rem;
}
.side-nav {
    display: grid;
    gap: 0.35rem;
    position: sticky;
    top: 100px;
}
.nav-button {
    border: 0;
    border-radius: 11px;
    text-align: left;
    padding: 0.72rem 0.85rem;
    color: var(--muted);
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 650;
}
.nav-button:hover {
    background: var(--mint);
    color: var(--forest);
}
.nav-button.active {
    color: var(--forest);
    background: #e2eee2;
    box-shadow: inset 3px 0 var(--forest-2);
}
.side-note {
    margin-top: 2rem;
    padding: 1rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.55;
    border-top: 1px solid var(--line);
}
.main {
    min-width: 0;
}
.page-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.45rem;
}
.eyebrow {
    margin: 0 0 0.3rem;
    color: var(--forest-2);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.69rem;
    font-weight: 800;
}
h1,
h2,
h3,
p {
    margin-top: 0;
}
h1 {
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    letter-spacing: -0.055em;
    line-height: 1.05;
    margin-bottom: 0.38rem;
}
h2 {
    font-size: 1.16rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.8rem;
}
h3 {
    font-size: 0.96rem;
    margin-bottom: 0.4rem;
}
.subtle {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.18rem;
}
.grid {
    display: grid;
    gap: 1rem;
}
.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stack {
    display: grid;
    gap: 1rem;
}
.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 0.62rem 0.92rem;
    font-weight: 750;
    font-size: 0.88rem;
    transition: 0.18s ease;
}
.button.primary {
    background: var(--forest);
    color: white;
    box-shadow: 0 6px 14px rgba(25, 62, 53, 0.14);
}
.button.primary:hover {
    background: #24584a;
    transform: translateY(-1px);
}
.button.secondary {
    background: #edf4ec;
    color: var(--forest);
    border-color: #d6e4d7;
}
.button.ghost {
    color: var(--forest-2);
    background: transparent;
    border-color: var(--line);
}
.button.warn {
    color: #784238;
    background: #f9e8e2;
    border-color: #efd0c7;
}
.button:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}
.animal-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem;
    margin-bottom: 1rem;
    background: linear-gradient(110deg, #edf4ea, #fffef9 70%);
    border-color: #d6e4d6;
}
.animal-photo {
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    border-radius: 22px;
    object-fit: cover;
    background: #d4e5d2;
    display: grid;
    place-items: center;
    font-size: 2rem;
    overflow: hidden;
}
.animal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.animal-meta {
    flex: 1;
    min-width: 0;
}
.animal-meta h2 {
    margin-bottom: 0.18rem;
    font-size: 1.35rem;
}
.animal-select {
    max-width: 12rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    background: white;
}
.stat {
    padding: 0.9rem;
    border-radius: 14px;
    background: #f2f6ef;
    border: 1px solid #e2ebe0;
}
.stat-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--forest);
}
.stat-label {
    color: var(--muted);
    font-size: 0.75rem;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}
.section-head h2 {
    margin: 0;
}
.event-list,
.report-list,
.regimen-list,
.container-list {
    display: grid;
    gap: 0.65rem;
}
.event {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.86rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fffefa;
}
.event-time {
    font-weight: 800;
    color: var(--forest);
    font-size: 0.9rem;
    white-space: nowrap;
}
.event-title {
    font-weight: 700;
    font-size: 0.91rem;
}
.event-instruction {
    color: var(--muted);
    font-size: 0.79rem;
    margin-top: 0.18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.event-review {
    margin-top: 0.4rem;
    padding: 0.38rem 0.5rem;
    border-left: 3px solid var(--gold);
    background: #fff8e9;
    color: #725529;
    font-size: 0.74rem;
    line-height: 1.35;
}
.event-badge,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0.22rem 0.48rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge.due {
    color: #714515;
    background: #f9edcf;
}
.badge.reported {
    color: #27624a;
    background: #def0e4;
}
.badge.overdue,
.badge.review {
    color: #7a3c34;
    background: #f8dfd9;
}
.badge.upcoming {
    color: #35626b;
    background: #e1eff0;
}
.badge.unknown {
    color: #5d5960;
    background: #eceaed;
}
.empty {
    padding: 2.1rem 1.4rem;
    border: 1px dashed #cbd9cc;
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
    background: #fafcf7;
}
.empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.notice {
    padding: 0.78rem 0.9rem;
    border-radius: 11px;
    font-size: 0.83rem;
    line-height: 1.45;
    background: #eef5ed;
    color: #365848;
    border: 1px solid #d5e5d7;
}
.notice.error {
    background: #fff0ec;
    border-color: #efcfc8;
    color: #7a3c34;
}
.notice.pending {
    background: #fff4dc;
    color: #73551a;
    border-color: #ead79e;
}
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    background:
        radial-gradient(circle at 13% 15%, #dceadf 0, transparent 33%),
        radial-gradient(circle at 93% 90%, #e7eed9 0, transparent 34%),
        var(--ivory);
}
.auth-card {
    width: min(440px, 100%);
    padding: clamp(1.4rem, 5vw, 2.35rem);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 20px 55px rgba(25, 62, 53, 0.12);
}
.auth-card .brand {
    margin-bottom: 2rem;
}
.auth-card h1 {
    font-size: 2rem;
}
.auth-card .subtle {
    margin-bottom: 1.5rem;
}
.auth-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.2rem;
    padding: 0.25rem;
    background: #f0f4ed;
    border-radius: 12px;
}
.auth-tabs button {
    flex: 1;
    border: 0;
    border-radius: 9px;
    min-height: 40px;
    color: var(--muted);
    background: transparent;
    font-weight: 700;
}
.auth-tabs button.active {
    color: var(--forest);
    background: white;
    box-shadow: 0 2px 8px rgba(25, 62, 53, 0.08);
}
.form {
    display: grid;
    gap: 0.85rem;
}
.field {
    display: grid;
    gap: 0.32rem;
}
.field label {
    font-size: 0.78rem;
    color: #486157;
    font-weight: 750;
}
.field small {
    color: var(--muted);
    font-size: 0.73rem;
    line-height: 1.4;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd8ce;
    border-radius: 10px;
    padding: 0.62rem 0.72rem;
    background: #fff;
    color: var(--ink);
}
.field textarea {
    min-height: 84px;
    resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
    color: #91a097;
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.35rem;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(25, 50, 44, 0.44);
}
.modal {
    position: relative;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    width: min(650px, 100%);
    background: var(--paper);
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 30px 80px rgba(25, 50, 44, 0.25);
    padding: 1.25rem;
}
.modal-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-right: 2.6rem;
}
.close {
    border: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eef4ec;
    color: var(--forest);
    font-size: 1.2rem;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}
.divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 0.6rem 0;
}
.check {
    display: flex;
    align-items: start;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}
.check input {
    margin-top: 0.2rem;
    accent-color: var(--forest-2);
}
.table-wrap {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.data-table th,
.data-table td {
    text-align: left;
    padding: 0.72rem 0.55rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.data-table th {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
}
.data-table td strong {
    display: block;
}
.data-table td small {
    display: block;
    color: var(--muted);
    margin-top: 0.18rem;
}
.entered-error td {
    background: #fff6f2;
}
.amendment-list {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.45rem;
}
.amendment {
    padding: 0.35rem 0.48rem;
    border-left: 3px solid var(--coral);
    background: #fff3ee;
    color: #75443d;
    font-size: 0.72rem;
    line-height: 1.35;
}
.regimen,
.container-row,
.grant-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.row-main {
    min-width: 0;
    flex: 1;
}
.row-main p {
    margin: 0;
}
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}
.stock-projection {
    display: grid;
    gap: 0.12rem;
    margin-top: 0.42rem;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.35;
}
.stock-projection strong {
    color: var(--forest);
    font-size: 0.76rem;
}
.stock-projection.low {
    padding: 0.38rem 0.5rem;
    border-left: 3px solid var(--coral);
    background: #fff4ef;
    color: #75443d;
}
.stock-projection.low strong {
    color: #8b3d32;
}
.inline-form {
    display: flex;
    align-items: stretch;
    gap: 0.45rem;
}
.inline-form input {
    flex: 1;
    min-width: 0;
}
.catalog-results {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.45rem;
}
.catalog-result {
    display: grid;
    gap: 0.1rem;
    width: 100%;
    padding: 0.48rem 0.58rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfdf8;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.catalog-result:hover,
.catalog-result:focus-visible {
    border-color: var(--sage);
    background: #f0f7ed;
}
.catalog-result span,
.selected-catalog {
    color: var(--muted);
    font-size: 0.74rem;
}
.selected-catalog {
    padding: 0.4rem 0.5rem;
    border-left: 3px solid var(--sage);
    background: #f2f7ef;
}
.med-title {
    font-weight: 800;
}
.med-facts {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 0.22rem;
}
.label-pill {
    padding: 0.18rem 0.45rem;
    border-radius: 5px;
    background: #f0f4ee;
    font-size: 0.7rem;
    color: var(--muted);
}
.photo-drop {
    display: grid;
    place-items: center;
    min-height: 100px;
    border: 1px dashed #b8cdbb;
    border-radius: 12px;
    background: #f5faf2;
    color: var(--muted);
    text-align: center;
    padding: 0.8rem;
}
.photo-drop input {
    width: 100%;
}
.connection {
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.connection::before {
    content: "";
    width: 7px;
    height: 7px;
    background: #7cad87;
    border-radius: 50%;
}
.connection.offline::before {
    background: var(--coral);
}
.connection.pending::before {
    background: var(--gold);
}
.invite-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}
.invite-qr {
    flex: 0 0 180px;
    text-align: center;
    color: var(--muted);
    font-size: 0.72rem;
}
.invite-qr canvas {
    margin: auto;
    border: 8px solid #fffef9;
}
.invite-copy {
    min-width: 0;
    flex: 1;
}
.invite-link {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.62rem 0.72rem;
    background: #fff;
    color: var(--forest-2);
}
.mobile-nav {
    display: none;
}
@media (max-width: 860px) {
    .app-layout {
        grid-template-columns: 1fr;
        padding-top: 1.2rem;
    }
    .sidebar {
        display: none;
    }
    .mobile-nav {
        display: flex;
        position: fixed;
        z-index: 15;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        justify-content: space-around;
        gap: 0.2rem;
        padding: 0.4rem;
        background: rgba(255, 254, 249, 0.95);
        border: 1px solid var(--line);
        box-shadow: 0 10px 30px rgba(25, 62, 53, 0.14);
        border-radius: 17px;
        backdrop-filter: blur(16px);
    }
    .mobile-nav .nav-button {
        min-height: 44px;
        padding: 0.35rem 0.55rem;
        display: grid;
        gap: 0;
        place-items: center;
        text-align: center;
        font-size: 0.68rem;
    }
    .mobile-nav .nav-button span:first-child {
        font-size: 1rem;
    }
    .main {
        padding-bottom: 4.8rem;
    }
}
@media (min-width: 560px) {
    .user-chip {
        display: inline;
    }
}
@media (max-width: 600px) {
    .topbar {
        min-height: 65px;
        padding: 0.7rem 1rem;
    }
    .app-layout {
        padding-inline: 0.85rem;
    }
    .grid.two,
    .grid.three {
        grid-template-columns: 1fr;
    }
    .event {
        grid-template-columns: 1fr auto;
    }
    .event-time {
        grid-column: 1/-1;
        font-size: 0.78rem;
    }
    .event .button {
        grid-column: 2;
        grid-row: 2/4;
    }
    .animal-hero {
        align-items: start;
        flex-wrap: wrap;
    }
    .animal-select {
        max-width: none;
        width: 100%;
    }
    .page-heading {
        align-items: start;
    }
    .page-heading .button {
        width: 100%;
    }
    .form-actions .button {
        flex: 1;
    }
    .card {
        padding: 0.95rem;
    }
}
@media (max-width: 600px) {
    .invite-card {
        align-items: stretch;
        flex-direction: column;
    }
    .invite-qr {
        flex-basis: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

[hidden] { display: none !important; }
.event-time small { display:block; font-size:.65rem; font-weight:400; line-height:1.5; overflow-wrap:anywhere; margin-top:.35rem; }
.amendment-change { display:block; margin:.25rem 0; }
.container-row .notice { margin:.6rem 0; }
.animal-hero { flex-wrap:wrap; }
.animal-meta { min-width:180px; }
.container-row, .event, .row-main { min-width:0; overflow-wrap:anywhere; }
.modal .notice.error { position:relative; margin:0 2rem 1rem 0; }
@media (max-width:600px) {
  .animal-hero { display:grid; grid-template-columns:56px minmax(0,1fr); align-items:start; gap:.75rem; }
  .animal-photo { width:56px; height:56px; border-radius:16px; }
  .animal-meta { min-width:0; width:auto; }
  .animal-meta h2 { font-size:1.25rem; word-break:normal; overflow-wrap:break-word; }
  .animal-hero > .field, .animal-hero > .button { grid-column:1 / -1; width:100%; }
  .animal-select { width:100%; max-width:none; }
  .animal-hero .eyebrow { font-size:.64rem; }
  .event { grid-template-columns:1fr; }
  .event-time { display:block; }
  .event-time small { display:inline; margin-left:.5rem; }
  .event-time small br { display:none; }
  .event > div:last-child { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; }
  .container-row { flex-wrap:wrap; }
  .topbar .user-chip { display:none; }
}

.compact-hero > .button { display:none; }
@media (max-width:600px) {
 .main > .grid.three { grid-template-columns:repeat(3,minmax(0,1fr)); gap:.5rem; }
 .main > .grid.three .stat { padding:.75rem .5rem; }
 .main > .grid.three .stat-value { font-size:1.5rem; }
 .main > .grid.three .stat-label { font-size:.66rem; }
}
