body {
background: #e9e9e9;
/*padding-bottom: 30px;
position: relative;
min-height: 100%;
*/
}

.footer-links {
    color: inherit; /* Use the default text color */
    text-decoration: none; /* Remove underline */
    cursor: pointer; /* Change cursor to indicate it's clickable */
}

/*
a {
transition: background 0.2s, color 0.2s;
}
a:hover,
a:focus {
text-decoration: none;
}
*/

.fluid-container {
    background: #cccccc;
    color: #000;
    border-radius: 15px;
    margin: 0px;
}


.z-form-div {
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 30px;
}

/*@media (max-width: 767px) {*/
@media (max-width: 991px) {
    .z-form-div {
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 30px;
    }
}


input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="url"],
select.form-control,
textarea.form-control {
    background-color: #fff;
    color: #000;
    border-radius: 10px;
    padding: 10px;
}

input[type="text"].form-control:disabled,
textarea.form-control:read-only {
    background-color: #bababa;
    color: #000;
    padding: 10px;
    border-radius: 10px;
}

footer {
    background: #222222;
    color: #fff;
}

#wrapper {
padding-left: 0;
transition: all 0.5s ease;
position: relative;
}

#wrapper.toggled #sidebar-wrapper {
width: 250px;
}

#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
height: 100%;
margin-left: -250px;
overflow-y: auto;
overflow-x: hidden;
background: #222;
transition: all 0.5s ease;
}

.sidebar-brand {
position: absolute;
top: 0;
width: 250px;
text-align: center;
padding: 20px 0;
padding-top: 5px;
}

.sidebar-brand h2 {
margin: 0;
font-weight: 600;
font-size: 24px;
color: #fff;
}

.sidebar-nav {
position: absolute;
top: 75px;
width: 250px;
margin: 0;
margin-top: 15px;
padding: 0;
padding-bottom: 40px;
list-style: none;
}

.sidebar-nav > li {
text-indent: 10px;
line-height: 42px;
}

.sidebar-nav > li a {
display: block;
text-decoration: none;
color: #757575;
font-weight: 600;
font-size: 18px;
}

.sidebar-nav > li > a:hover,
.sidebar-nav > li.active > a {
text-decoration: none;
color: #000;
background: #00e2ff;
}

.sidebar-nav > li > a i.fa {
font-size: 24px;
width: 60px;
}

#navbar-wrapper {
    width: 100%;
    position: absolute;
    z-index: 2;
}

#wrapper.toggled #navbar-wrapper {
    position: absolute;
    margin-right: -250px;
}


#navbar-wrapper .navbar {
border-width: 0 0 0 0;
background-color: #00e2ff;
color: #000;
font-size: 24px;
margin-bottom: 0;
border-radius: 0;
}

#navbar-wrapper .navbar a {
color: #757575;
}

#navbar-wrapper .navbar a:hover {
color: #00e2ff;
}

#content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
top: 100px;
}

#wrapper.toggled #content-wrapper {
position: absolute;
margin-right: -250px;
}

#close-sidebar {
    display: none; /* Hidden by default */
    background-color: #f00; /* Example background color */
    color: #fff; /* Example text color */
    border: none;
    cursor: pointer;
}

@media (min-width: 992px) {
    #wrapper {
        padding-left: 250px;
    }
    
    #wrapper.toggled {
        padding-left: 60px;
    }

    #sidebar-wrapper {
        width: 250px;
    }
    
    #wrapper.toggled #sidebar-wrapper {
        width: 60px;
    }
    
    #wrapper.toggled #navbar-wrapper {
        position: absolute;
        margin-right: -190px;
    }
    
    #wrapper.toggled #content-wrapper {
        position: absolute;
        margin-right: -190px;
    }

    #navbar-wrapper {
        position: sticky;
        top: 0;
    }

    #wrapper.toggled {
        padding-left: 60px;
    }

    #content-wrapper {
        position: relative;
        top: 0;
    }

    #wrapper.toggled #navbar-wrapper,
    #wrapper.toggled #content-wrapper {
        position: sticky;
        top: 0;
        margin-right: 60px;
    }
}

/*
@media (min-width: 768px) and (max-width: 991px) {
    #wrapper {
        padding-left: 60px;
    }

    #sidebar-wrapper {
        width: 60px;
    }
    
    #wrapper.toggled #navbar-wrapper {
        position: absolute;
        margin-right: -250px;
    }
    
    #wrapper.toggled #content-wrapper {
        position: absolute;
        margin-right: -250px;
    }

    #navbar-wrapper {
        position: sticky;
        top: 0;
    }

    #wrapper.toggled {
        padding-left: 250px;
    }

    #content-wrapper {
        position: relative;
        top: 0;
    }

    #wrapper.toggled #navbar-wrapper,
    #wrapper.toggled #content-wrapper {
        position: sticky;
        top: 0;
        margin-right: 250px;
    }
}
*/

/*@media (max-width: 767px) {*/
@media (max-width: 991px) {
    #wrapper {
        padding-left: 0;
    }

    #sidebar-wrapper {
        width: 0;
    }

    #wrapper.toggled #sidebar-wrapper {
        width: 100vw; /*250px;*/
    }
    #wrapper.toggled #navbar-wrapper {
        position: absolute;
        margin-right: -250px;
    }

    #wrapper.toggled #content-wrapper {
        position: absolute;
        margin-right: -250px;
    }

    #navbar-wrapper {
        position: sticky;
        top: 0;
    }

    #wrapper.toggled {
        padding-left: 250px;
    }

    #content-wrapper {
        position: relative;
        top: 0;
    }

    #wrapper.toggled #navbar-wrapper,
    #wrapper.toggled #content-wrapper {
        position: relative;
        margin-right: 250px;
    }

    #close-sidebar {
        display: block; /* Show only in mobile view */
    }
    
    .sidebar-brand {
    width: 90vw; /*250px;*/
    padding-top: 5px;
    }
    
    .sidebar-brand img {
    margin-left: 10%;
    }
    
    .sidebar-nav {
        width: 100vw; /*250px;*/
    }
}

.disabled-breeding-field {
    opacity: 0.6; /* Dim the element */
    cursor: not-allowed;
}


/* ============================================================
   PasturePulse Design System  (pp-* primitives)
   ------------------------------------------------------------
   One brand cyan (#00e2ff) = primary actions.
   One brand purple (#9d00f4) = secondary accent.
   Status colors (green/amber/red) are semantic, kept separate
   from the brand palette on purpose. Reuse these classes across
   pages instead of re-inventing inline styles.
   ============================================================ */

:root {
    /* Brand */
    --pp-cyan: #00e2ff;
    --pp-cyan-600: #00c2db;
    /* cyan-700 doubles as the readable "cyan text on light" token — dark enough
       for legible heading/link text on white (WCAG AA large text). */
    --pp-cyan-700: #0a7c8c;
    --pp-purple: #9d00f4;
    --pp-purple-600: #8400cc;

    /* Status (semantic, not brand) */
    --pp-ok: #16a34a;
    --pp-ok-soft: #e7f6ec;
    --pp-warn: #b45309;
    --pp-warn-soft: #fdf0dd;
    --pp-danger: #dc2626;

    /* Neutrals */
    --pp-ink: #16181d;
    --pp-muted: #6b7280;
    --pp-line: #e7e9ee;
    --pp-surface: #ffffff;

    /* Shape & motion */
    --pp-radius: 16px;
    --pp-radius-sm: 12px;
    --pp-radius-pill: 999px;
    --pp-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
    --pp-shadow: 0 2px 8px rgba(16, 24, 40, .06), 0 12px 28px rgba(16, 24, 40, .06);
    --pp-shadow-lg: 0 10px 24px rgba(16, 24, 40, .10), 0 24px 56px rgba(16, 24, 40, .10);
    --pp-ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---- Page shell ---- */
.pp-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 4px 18px 48px;
}

/* ---- Headings ---- */
.pp-header {
    margin: 10px 2px 22px;
}

.pp-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--pp-ink);
    margin: 0;
}

.pp-subtitle {
    margin: 8px 0 0;
    color: var(--pp-muted);
    font-size: .95rem;
    line-height: 1.6;
    max-width: 70ch;
}

/* ---- Stat cards ---- */
.pp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.pp-stat {
    flex: 1 1 150px;
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius-sm);
    padding: 14px 16px;
    box-shadow: var(--pp-shadow-sm);
}

.pp-stat__label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--pp-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pp-stat__value {
    margin-top: 6px;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--pp-ink);
    line-height: 1;
}

.pp-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.pp-dot--cyan { background: var(--pp-cyan); }
.pp-dot--ok   { background: var(--pp-ok); }
.pp-dot--warn { background: var(--pp-warn); }

/* ---- Buttons ---- */
.pp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: .95rem;
    padding: 11px 22px;
    border: 1px solid transparent;
    border-radius: var(--pp-radius-pill);
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: transform .15s var(--pp-ease), box-shadow .2s var(--pp-ease), background .2s var(--pp-ease);
}

.pp-btn:active { transform: translateY(1px); }

.pp-btn-primary {
    background: var(--pp-cyan);
    color: #05323a;
    box-shadow: 0 2px 10px rgba(0, 226, 255, .35);
}

.pp-btn-primary:hover {
    background: var(--pp-cyan-600);
    color: #05323a;
    box-shadow: 0 4px 16px rgba(0, 226, 255, .45);
}

.pp-btn-accent {
    background: var(--pp-purple);
    color: #fff;
    box-shadow: 0 2px 10px rgba(157, 0, 244, .30);
}

.pp-btn-accent:hover {
    background: var(--pp-purple-600);
    color: #fff;
    box-shadow: 0 4px 16px rgba(157, 0, 244, .40);
}

.pp-btn-ghost {
    background: var(--pp-surface);
    color: var(--pp-ink);
    border-color: var(--pp-line);
}

.pp-btn-ghost:hover { border-color: var(--pp-cyan); }

/* ---- Toolbar / inputs ---- */
.pp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 4px 0 20px;
}

.pp-field {
    flex: 1 1 200px;
    position: relative;
}

.pp-search .pp-input { padding-left: 42px; }

.pp-search__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pp-muted);
    pointer-events: none;
    font-size: .9rem;
}

.pp-input,
select.pp-input {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--pp-surface);
    color: var(--pp-ink);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius-pill);
    padding: 11px 16px;
    font-size: .95rem;
    font-family: inherit;
    box-shadow: var(--pp-shadow-sm);
    transition: border-color .2s var(--pp-ease), box-shadow .2s var(--pp-ease);
}

.pp-input:focus {
    outline: none;
    border-color: var(--pp-cyan);
    box-shadow: 0 0 0 3px rgba(0, 226, 255, .18);
}

select.pp-input {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

/* ---- List items (clickable rows) ---- */
.pp-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pp-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius);
    padding: 14px 16px;
    box-shadow: var(--pp-shadow-sm);
    cursor: pointer;
    transition: transform .18s var(--pp-ease), box-shadow .2s var(--pp-ease), border-color .2s var(--pp-ease);
}

.pp-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--pp-shadow);
    border-color: rgba(0, 226, 255, .55);
}

.pp-item__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #f1f3f5;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--pp-line);
    flex-shrink: 0;
}

.pp-item__body {
    flex-grow: 1;
    min-width: 0;
}

.pp-item__title {
    font-weight: 700;
    color: var(--pp-ink);
    font-size: 1.02rem;
}

.pp-item__title .pp-age {
    color: var(--pp-muted);
    font-weight: 500;
    font-size: .9rem;
}

.pp-item__chevron {
    color: #c3c8d0;
    font-size: .9rem;
    transition: transform .18s var(--pp-ease), color .2s var(--pp-ease);
}

.pp-item:hover .pp-item__chevron {
    color: var(--pp-cyan);
    transform: translateX(3px);
}

/* ---- Badges ---- */
.pp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: .74rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--pp-radius-pill);
    line-height: 1.4;
}

.pp-badge--warn { background: var(--pp-warn-soft); color: var(--pp-warn); }
.pp-badge--ok   { background: var(--pp-ok-soft);   color: var(--pp-ok); }

/* ---- Empty state ---- */
.pp-empty {
    text-align: center;
    padding: 48px 20px;
    background: var(--pp-surface);
    border: 1px dashed var(--pp-line);
    border-radius: var(--pp-radius);
}

.pp-empty__icon {
    font-size: 1.9rem;
    color: var(--pp-cyan);
    background: rgba(0, 226, 255, .12);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.pp-empty__title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--pp-ink);
    margin-bottom: 6px;
}

.pp-empty__text {
    color: var(--pp-muted);
    margin-bottom: 20px;
}

/* ---- Entrance animation ---- */
@keyframes pp-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pp-animate { animation: pp-fade-up .4s var(--pp-ease) both; }
.pp-animate.d1 { animation-delay: .05s; }
.pp-animate.d2 { animation-delay: .10s; }

/* ---- Mobile ---- */
@media (max-width: 575px) {
    .pp-page { padding: 4px 12px 40px; }
    .pp-title { font-size: 1.4rem; }
    .pp-stat { flex: 1 1 100%; }
    .pp-stat__value { font-size: 1.5rem; }
}


/* ============================================================
   PasturePulse Design System — shared components (batch 2)
   Cards, section titles, forms, tables, alerts, buttons, and
   the pp-multiselect animal picker. All additive; pages opt in.
   ============================================================ */

/* ---- Content / form card ---- */
.pp-card {
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-shadow-sm);
    padding: 22px;
}

.pp-card + .pp-card { margin-top: 18px; }

@media (max-width: 575px) {
    .pp-card { padding: 16px; border-radius: var(--pp-radius-sm); }
}

/* ---- Section title (replaces dark #494949 pill headers) ---- */
.pp-section-title {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 9px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--pp-ink);
    margin: 6px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pp-line);
    white-space: nowrap;
}

.pp-section-title i { color: var(--pp-cyan-700); flex-shrink: 0; }

/* ---- Form primitives ---- */
.pp-field-group { margin-bottom: 18px; }
.pp-field-group:last-child { margin-bottom: 0; }

.pp-label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    color: var(--pp-ink);
    margin-bottom: 8px;
}

.pp-label small,
.pp-required { color: var(--pp-muted); font-weight: 500; }
.pp-required { font-size: .82rem; }

.pp-hint { font-size: .82rem; color: var(--pp-muted); margin-top: 6px; }

/* Polish the existing Bootstrap form controls app-wide (markup-safe:
   only touches appearance, never behavior). */
.form-control,
.form-select {
    border-radius: var(--pp-radius-sm);
    border-color: var(--pp-line);
    padding: 11px 14px;
    transition: border-color .2s var(--pp-ease), box-shadow .2s var(--pp-ease);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--pp-cyan);
    box-shadow: 0 0 0 3px rgba(0, 226, 255, .18);
}

.form-label { font-weight: 600; font-size: .92rem; }

/* ---- Buttons: extra variants ---- */
.pp-btn-danger {
    background: var(--pp-danger);
    color: #fff;
    box-shadow: 0 2px 10px rgba(220, 38, 38, .28);
}
.pp-btn-danger:hover { background: #b91c1c; color: #fff; box-shadow: 0 4px 16px rgba(220, 38, 38, .38); }

.pp-btn-sm { padding: 8px 15px; font-size: .85rem; }
.pp-btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.pp-btn-block { width: 100%; }
.pp-btn:disabled,
.pp-btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* "Repeat every" number and interval stay on one line; both shrink on phones
   (their max-widths are inline in each form). */
.pp-interval-row {
    display: flex;
    gap: 8px;
}
.pp-interval-row > .form-control { flex: 0 1 140px; min-width: 0; }
.pp-interval-row > .form-select { flex: 0 1 220px; min-width: 0; }

.reminder-option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.reminder-option[hidden] { display: none; }

.reminder-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
}

.reminder-option input {
    margin-top: 3px;
    accent-color: #9d00f4;
    flex-shrink: 0;
}

.reminder-option span {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #333;
}

.reminder-option .reminder-option-hint {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    color: #4b5563;
}

/* Plain text under the checkboxes; colors come from .reminder-repeat-hint. */
.reminder-option-list .reminder-option-note { margin: 0 0 0 4px; }
.reminder-option-list .reminder-option-note[hidden] { display: none; }

.reminder-option:has(input:checked) {
    border-color: #9d00f4;
    background: #faf5ff;
}

/* ---- Record and reminder tables ----
   Shared by /records, /reminders and the Animal page's Records and Reminders
   tabs. A light cyan card holds the search, filters, selection bar and a
   table of white rows under a charcoal header ("5d" on the Reminder Table
   Designs canvas). Rows are clickable: cyan hover, cyan left bar and a
   chevron. On phones
   Frequency, End Date and Notes (.pp-wide-only) move under the title
   (.pp-row-meta). Row clicks and selection live in each page and in
   static/js/pp-bulk-select.js. */
.pp-table-card {
    background: #e5f6fa;
    border: 1px solid #c3e5ee;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(8, 72, 88, 0.08);
    padding: 20px;
    margin: 0 12px 24px;
}

.pp-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pp-table-toolbar .pp-search { flex: 1 1 260px; width: auto; }

/* Wide enough for "Medications/Supplements"; the search box takes the rest */
.pp-table-filter {
    flex: 0 1 250px;
    width: auto;
    border-radius: 999px;
}

.pp-table-card .pp-selection-bar { margin: 0 0 12px; }
.pp-table-card .pagination { margin: 16px 0 0; }

.pp-table-footnote {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #3f5a62;
}

.pp-search .input-group-text {
    border-radius: 999px 0 0 999px;
    border-color: #bcdfe8;
    border-right: none;
    background-color: #ffffff;
    color: #4b6f79;
}

.pp-search .form-control {
    border-radius: 0 999px 999px 0;
    border-color: #bcdfe8;
    border-left: none;
    background-color: #ffffff;
}

.pp-table-filter { border-color: #bcdfe8; }

.pp-data-table {
    margin-bottom: 0;
    font-size: 14px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(8, 72, 88, 0.08);
}

/* The row is charcoal too, so sub-pixel gaps between header cells on
   phones show charcoal instead of a thin white line */
.pp-data-table > thead,
.pp-data-table > thead > tr { background-color: #374151; }

.pp-data-table > thead > tr > th {
    background-color: #374151;
    color: #f3f4f6;
    border-color: #374151;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

.pp-data-table > tbody > tr > td {
    padding: 14px;
    color: #3f5a62;
    background-color: #ffffff;
    border-bottom-color: #e1eff3;
    vertical-align: middle;
}

.pp-data-table input[type="checkbox"] { accent-color: #0099d6; }

/* Only real rows are clickable, not the "No records found." row */
.pp-data-table > tbody > tr:is([data-record-id], [data-notification-id]) {
    cursor: pointer;
}

.pp-data-table > tbody > tr > td {
    transition: background-color .15s ease, box-shadow .15s ease;
}

/* Hover only on devices that really hover; on touch screens :hover sticks
   to the last tapped row and would hide the selected tint. */
@media (hover: hover) {
    .pp-data-table > tbody > tr:is([data-record-id], [data-notification-id]):hover > td {
        background-color: #cdeefb;
    }

    .pp-data-table > tbody > tr:is([data-record-id], [data-notification-id]):hover > td:first-child {
        box-shadow: inset 4px 0 0 #0099d6;
    }
}

/* Selected rows: the same light purple for records and reminders, kept over the hover */
.pp-data-table > tbody > tr.record-selected > td,
.pp-data-table > tbody > tr.reminder-selected > td,
.pp-data-table > tbody > tr.record-selected:hover > td,
.pp-data-table > tbody > tr.reminder-selected:hover > td { background-color: #f6ebfe; }

.pp-row-title {
    font-weight: 600;
    color: #0f2a31;
}

.pp-name-cell { color: #3f5a62; }

.pp-chevron-cell {
    width: 1%;
    text-align: right;
    color: #8fb1ba;
}

.pp-chevron-cell i { transition: color .15s ease, transform .15s ease; }

@media (hover: hover) {
    .pp-data-table > tbody > tr:hover .pp-chevron-cell i {
        color: #0099d6;
        transform: translateX(2px);
    }
}

/* Recurring frequency: cyan pill with a repeat icon. One Time stays plain text. */
.pp-freq-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #dcf2f7;
    color: #0b5a80;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.pp-row-meta { display: none; }

@media (max-width: 768px) {
    .pp-table-card {
        padding: 12px;
        margin: 0 0 16px;
    }

    .pp-table-toolbar { gap: 8px; margin-bottom: 12px; }
    .pp-table-toolbar .pp-search { flex-basis: 100%; }
    .pp-table-filter { flex: 1 1 calc(50% - 4px); min-height: 44px; }
    .pp-table-filter.pp-table-filter-wide { flex-basis: 100%; }
    .pp-search .form-control,
    .pp-search .input-group-text { min-height: 44px; font-size: 16px; }

    .pp-wide-only { display: none; }

    .pp-data-table > thead > tr > th {
        padding: 10px 4px;
        font-size: 11px;
    }

    .pp-data-table > tbody > tr > td {
        padding: 12px 4px;
        font-size: 13px;
        vertical-align: top;
    }

    .pp-data-table .pp-date-cell { font-size: 12px; }

    /* Cap Name so Title gets the room; long names wrap */
    .pp-data-table .pp-name-cell {
        width: 25%;
        font-weight: 600;
        color: #0f2a31;
        overflow-wrap: anywhere;
    }

    /* With a Name column, the name is the bold one on phones */
    .pp-data-table.pp-has-name-col .pp-row-title { font-weight: 400; }
    .pp-row-title { overflow-wrap: anywhere; }

    .pp-row-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        margin-top: 4px;
        font-size: 12px;
        color: #3f5a62;
    }

    .pp-row-meta .pp-freq-pill { padding: 2px 8px; gap: 4px; }

    /* End date always gets its own line under the pill; order keeps the notes icon beside the pill */
    .pp-row-meta .pp-row-until { flex-basis: 100%; order: 1; }

    .pp-chevron-cell { padding-left: 2px !important; padding-right: 2px !important; vertical-align: middle !important; }
}

/* ---- Record and reminder details modals ----
   Shared by /records, /reminders and the Animal page so the four details
   popups look the same: dark value boxes with a cyan glow, square buttons. */
.pp-detail-value {
    background: #434343;
    border-radius: 15px;
    padding: 15px;
    align-self: center;
    box-shadow: 0 0 8px #00e2ff;
    min-height: 55px;
}

/* Each value box is also a grid column, and its own padding replaces the
   column gutter, so on phones the row's negative margins pushed it to the
   modal edge. Inset it by the gutter so it lines up with its label. */
@media (max-width: 767.98px) {
    .pp-detail-value {
        margin-left: calc(var(--bs-gutter-x) * .5);
        margin-right: calc(var(--bs-gutter-x) * .5);
        width: calc(100% - var(--bs-gutter-x));
    }
}

.pp-detail-button {
    width: 150px;
    margin: 25px;
}

/* Phones: two buttons per line, in the same order as desktop */
@media (max-width: 575.98px) {
    .modal-footer .pp-detail-button {
        width: 40%;
        margin: 10px 4%;
        padding-left: 6px;
        padding-right: 6px;
    }
}

.pp-detail-button-complete,
.pp-detail-button-complete:hover,
.pp-detail-button-complete:focus {
    background-color: #01e2ff;
    border-color: #01e2ff;
    color: #000;
}

.pp-detail-button-complete:hover { filter: brightness(0.92); }

/* ---- Badges: extra variants ---- */
.pp-badge--info   { background: rgba(0, 226, 255, .14); color: var(--pp-cyan-700); }
.pp-badge--muted  { background: #eef1f4; color: var(--pp-muted); }
.pp-badge--danger { background: #fdecec; color: var(--pp-danger); }

/* ---- Alert / banner ---- */
.pp-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--pp-radius-sm);
    border: 1px solid var(--pp-line);
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow-sm);
    font-size: .92rem;
    line-height: 1.55;
}
.pp-alert i { margin-top: 2px; }
.pp-alert--warn { background: var(--pp-warn-soft); border-color: #f3dcbc; color: #7c4a12; }
.pp-alert--warn i { color: var(--pp-warn); }
.pp-alert--info { background: rgba(0, 226, 255, .09); border-color: rgba(0, 226, 255, .3); color: #0b5563; }
.pp-alert--info i { color: var(--pp-cyan-700); }

.reminder-repeat-hint {
    display: block;
    margin: 8px 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #5c6775;
}
.modal-content .reminder-repeat-hint {
    color: #b1b1b1;
}

.record-recurring-note {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #f3dcbc;
    color: #7c4a12;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* "Edit the reminder" link on a record copied from a reminder */
.record-recurring-note a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

/* ---- Table ---- */
.pp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius);
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow-sm);
}

.pp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

.pp-table thead th {
    background: #f7f8fa;
    color: var(--pp-muted);
    font-weight: 700;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--pp-line);
    white-space: nowrap;
}

.pp-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--pp-line);
    color: var(--pp-ink);
    vertical-align: middle;
}

.pp-table tbody tr:last-child td { border-bottom: 0; }
.pp-table tbody tr { transition: background .13s var(--pp-ease); }
.pp-table tbody tr:hover { background: #f7fbfc; }
.pp-table tbody tr.pp-row-click { cursor: pointer; }
.pp-table .num { text-align: right; font-variant-numeric: tabular-nums; }


/* ============================================================
   pp-multiselect — dependency-free animal / group picker
   ============================================================ */
.ms { position: relative; }

/* A picker's mirrored <select required> sits invisibly along the bottom of its
   field, so the browser's "required" bubble has a place to point. */
.ms-required-anchor {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    min-height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.ms-control {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: var(--pp-shadow-sm);
    text-align: left;
    font-family: inherit;
    transition: border-color .2s var(--pp-ease), box-shadow .2s var(--pp-ease);
}
.ms-control:hover { border-color: #cfd3da; }
.ms.open .ms-control { border-color: var(--pp-cyan); box-shadow: 0 0 0 3px rgba(0, 226, 255, .18); }

.ms-chips { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; align-items: center; }
.ms-placeholder { color: var(--pp-muted); font-size: .95rem; }
.ms-caret { color: var(--pp-muted); transition: transform .2s var(--pp-ease); flex-shrink: 0; }
.ms.open .ms-caret { transform: rotate(180deg); }

.ms-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 6px 4px 4px; border-radius: var(--pp-radius-pill);
    font-size: .82rem; font-weight: 600; max-width: 100%;
    background: #eef1f4; color: var(--pp-ink);
    animation: pp-chip-in .18s var(--pp-ease) both;
}
.ms-chip__av { width: 22px; height: 22px; border-radius: 50%; background: #dfe3e8; object-fit: cover; display: grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.ms-chip__x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .06); color: var(--pp-muted); cursor: pointer; flex-shrink: 0; transition: background .15s, color .15s; }
.ms-chip__x:hover { background: var(--pp-warn-soft); color: var(--pp-warn); }
.ms-chip--group { background: rgba(0, 226, 255, .14); color: var(--pp-cyan-700); }
.ms-chip--group .ms-chip__av { background: rgba(0, 226, 255, .28); color: var(--pp-cyan-700); }
.ms-chip__count { font-weight: 700; opacity: .7; font-size: .74rem; }
@keyframes pp-chip-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

.ms-scrim { display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 45; }

/* Desktop: panel expands inline inside its container (never overflows / clips) */
.ms-panel {
    position: relative;
    margin-top: 8px;
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 360px;
    transform-origin: top center;
    animation: pp-panel-in .18s var(--pp-ease) both;
}
/* A class selector beats the UA [hidden] rule, so restore it explicitly. */
.ms-panel[hidden] { display: none; }
@keyframes pp-panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.ms-panel__head { padding: 12px 12px 8px; border-bottom: 1px solid var(--pp-line); }
.ms-search { position: relative; }
.ms-search__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--pp-muted); pointer-events: none; }
.ms-search input { width: 100%; border: 1px solid var(--pp-line); border-radius: var(--pp-radius-pill); padding: 10px 14px 10px 38px; font-family: inherit; font-size: .92rem; background: #f7f8fa; }
.ms-search input:focus { outline: none; border-color: var(--pp-cyan); background: #fff; box-shadow: 0 0 0 3px rgba(0, 226, 255, .15); }

.ms-panel__body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px; flex: 1 1 auto; }
.ms-section { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--pp-muted); padding: 10px 10px 4px; }

.ms-opt { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; font-family: inherit; text-align: left; transition: background .13s var(--pp-ease); }
.ms-opt:hover { background: #f4f6f8; }
.ms-opt__av { width: 34px; height: 34px; border-radius: 50%; background: #eef1f4; object-fit: cover; display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.ms-opt--group .ms-opt__av { background: rgba(0, 226, 255, .16); color: var(--pp-cyan-700); }
.ms-opt__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ms-opt__name { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-opt__meta { display: block; font-size: .78rem; color: var(--pp-muted); }
.ms-check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--pp-line); flex-shrink: 0; display: grid; place-items: center; color: #fff; transition: background .15s var(--pp-ease), border-color .15s var(--pp-ease); }
.ms-check svg { opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s var(--pp-ease); }
.ms-opt[aria-selected="true"] { background: rgba(0, 226, 255, .07); }
.ms-opt[aria-selected="true"] .ms-check { background: var(--pp-cyan); border-color: var(--pp-cyan); }
.ms-opt[aria-selected="true"] .ms-check svg.tick { opacity: 1; transform: scale(1); }
.ms-opt[data-state="partial"] .ms-check { background: var(--pp-cyan); border-color: var(--pp-cyan); }
.ms-opt[data-state="partial"] .ms-check svg.tick { display: none; }
.ms-opt[data-state="partial"] .ms-check svg.dash { opacity: 1; transform: scale(1); }
.ms-check svg.dash { opacity: 0; }

.ms-noresults { text-align: center; color: var(--pp-muted); padding: 26px 10px; font-size: .9rem; }

.ms-panel__foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--pp-line); background: #fbfcfd; }
.ms-count { font-size: .85rem; color: var(--pp-muted); font-weight: 600; margin-right: auto; }
.ms-count b { color: var(--pp-ink); }
.ms-link { background: none; border: 0; color: var(--pp-cyan-700); font-weight: 600; font-family: inherit; font-size: .85rem; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.ms-link:hover { background: rgba(0, 226, 255, .1); }
.ms-done { padding: 9px 18px; }

.ms-sheet-head { display: none; }

/* Mobile: panel becomes a bottom sheet with a dimmed scrim */
@media (max-width: 575px) {
    .ms.open .ms-scrim { display: block; animation: pp-fade .2s var(--pp-ease) both; }
    .ms-panel { position: fixed; z-index: 50; margin-top: 0; top: auto; bottom: 0; left: 0; right: 0; max-height: 82vh; border-radius: 20px 20px 0 0; animation: pp-sheet-in .26s var(--pp-ease) both; }
    .ms-sheet-head { display: block; text-align: center; padding-top: 10px; }
    .ms-sheet-head::before { content: ""; display: inline-block; width: 38px; height: 4px; border-radius: 2px; background: #d6dae0; }
    .ms-opt { padding: 12px 10px; }
    .ms-opt__av { width: 38px; height: 38px; }
    .ms-check { width: 26px; height: 26px; }
}
@keyframes pp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pp-sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    .pp-animate, .ms-chip, .ms-panel { animation: none; }
}

/* Nested warning on a dark Log Heat modal. Amber shell so it reads as a
   warning, not Bootstrap white and not a second identical dark form. */
#heatGapConfirmModal,
#confirmationHeatGapModal {
    z-index: 1070;
}
.modal-content.heat-gap-modal {
    background: var(--pp-warn-soft);
    color: var(--pp-ink);
    border: 1px solid #f0d9b0;
    border-radius: var(--pp-radius);
    box-shadow: inset 4px 0 0 var(--pp-warn), var(--pp-shadow-lg);
}
.modal-content.heat-gap-modal .modal-header,
.modal-content.heat-gap-modal .modal-body,
.modal-content.heat-gap-modal .modal-footer {
    background: transparent;
    color: inherit;
}
.modal-content.heat-gap-modal .modal-header {
    border-bottom-color: rgba(180, 83, 9, 0.16);
}
.modal-content.heat-gap-modal .modal-footer {
    border-top-color: rgba(180, 83, 9, 0.16);
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.modal-content.heat-gap-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--pp-ink);
}
.heat-gap-modal__icon {
    color: #c48a00;
    font-size: 1.05em;
}
.modal-content.heat-gap-modal .modal-body {
    line-height: 1.55;
    color: #3f3f46;
}
.modal-content.heat-gap-modal .modal-header .btn-close {
    filter: none;
}
.heat-gap-modal__btn {
    min-width: 140px;
    margin: 8px;
    border-radius: 12px;
}
.heat-gap-modal__confirm {
    background: var(--pp-cyan);
    color: #05323a;
    border: none;
    font-weight: 600;
}
.heat-gap-modal__confirm:hover,
.heat-gap-modal__confirm:focus {
    background: var(--pp-cyan-600);
    color: #05323a;
}
.heat-info-popover {
    z-index: 1085;
}

/* Log Heat: stay inside the phone viewport instead of spilling off the edges. */
#logHeatModal .modal-dialog,
#animalLogHeatModal .modal-dialog,
#doeQuickViewModal .modal-dialog {
    margin: 12px auto;
    max-width: min(500px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
}
#logHeatModal .modal-content,
#animalLogHeatModal .modal-content,
#doeQuickViewModal .modal-content {
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    position: relative;
}
#logHeatModal .modal-body,
#animalLogHeatModal .modal-body,
#doeQuickViewModal .modal-body {
    padding: 16px 18px;
}
#doeQuickViewTimeline {
    overflow-x: auto;
}
.heat-modal-more {
    display: none;
}

.heat-signs-only {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin-top: 2px;
    padding: 12px 14px;
    border: 1px dashed #d97706;
    border-radius: 12px;
    background: rgba(217, 119, 6, 0.14);
    color: #fde68a;
    cursor: pointer;
    user-select: none;
    text-align: left;
}
.heat-signs-only input {
    margin: 3px 0 0;
    flex-shrink: 0;
    accent-color: #d97706;
}
.heat-signs-only__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.heat-signs-only__title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #fcd34d;
    line-height: 1.3;
}
.heat-signs-only__hint {
    font-size: 0.78rem;
    color: #e7d3a3;
    line-height: 1.35;
}
.heat-signs-only:has(input:checked) {
    border-style: solid;
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.22);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}
#logHeatModal .heat-log-modal-lead,
#animalLogHeatModal .heat-log-modal-lead {
    font-size: 0.86rem;
    color: #b1b1b1;
    margin-bottom: 12px;
    line-height: 1.4;
}
#logHeatModal .modal-footer,
#animalLogHeatModal .modal-footer,
#doeQuickViewModal .modal-footer {
    gap: 8px;
    padding: 10px 16px 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
#logHeatModal .modal-footer .btn,
#animalLogHeatModal .modal-footer .btn,
#doeQuickViewModal .modal-footer .btn {
    width: auto;
    min-width: 110px;
    margin: 0;
}
#animalLogHeatSigns.heat-sign-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
#animalLogHeatModal .heat-sign-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #555;
    border-radius: 10px;
    background: #2a2a2a;
    color: #fff;
    cursor: pointer;
    user-select: none;
    font-size: 0.92rem;
}
#animalLogHeatModal .heat-sign-chip input { margin: 0; }
#animalLogHeatModal .heat-sign-chip:has(input:checked) {
    border-color: #00e2ff;
    background: #1a3a40;
    box-shadow: 0 0 8px rgba(0, 226, 255, 0.35);
}

@media (max-width: 575.98px) {
    #logHeatModal .modal-dialog,
    #animalLogHeatModal .modal-dialog,
    #doeQuickViewModal .modal-dialog {
        margin: 8px auto;
        max-width: calc(100vw - 16px);
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }
    #logHeatModal .modal-content,
    #animalLogHeatModal .modal-content,
    #doeQuickViewModal .modal-content {
        max-height: calc(100dvh - 16px);
    }
    #logHeatModal .modal-header,
    #animalLogHeatModal .modal-header,
    #doeQuickViewModal .modal-header {
        padding: 12px 14px;
    }
    #logHeatModal .modal-body,
    #animalLogHeatModal .modal-body,
    #doeQuickViewModal .modal-body {
        padding: 12px 14px;
    }
    #doeQuickViewModal .heat-doe-section {
        margin: 16px 0 10px;
    }
    #doeQuickViewModal .heat-log-table th:first-child,
    #doeQuickViewModal .heat-log-table td:first-child {
        min-width: 0;
        padding-left: 6px;
        padding-right: 6px;
    }
    #doeQuickViewModal .heat-log-table th,
    #doeQuickViewModal .heat-log-table td {
        padding: 8px 6px;
    }
    #logHeatModal .mb-3,
    #animalLogHeatModal .mb-3 {
        margin-bottom: 0.7rem !important;
    }
    #logHeatModal .heat-sign-chip,
    #animalLogHeatModal .heat-sign-chip {
        padding: 8px 10px;
        font-size: 0.84rem;
    }
    #logHeatModal .modal-footer .btn,
    #animalLogHeatModal .modal-footer .btn,
    #doeQuickViewModal .modal-footer .btn {
        flex: 1 1 40%;
        max-width: 160px;
    }

    /* Scroll the whole sheet so Cancel/Save/Close sit at the true end.
       A fade + "More" cue shows while content is clipped. */
    #logHeatModal .modal-dialog-scrollable,
    #animalLogHeatModal .modal-dialog-scrollable,
    #doeQuickViewModal .modal-dialog-scrollable {
        height: auto;
        max-height: calc(100dvh - 16px);
    }
    #logHeatModal .modal-dialog-scrollable .modal-content,
    #animalLogHeatModal .modal-dialog-scrollable .modal-content,
    #doeQuickViewModal .modal-dialog-scrollable .modal-content {
        max-height: calc(100dvh - 16px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #logHeatModal .modal-dialog-scrollable .modal-body,
    #animalLogHeatModal .modal-dialog-scrollable .modal-body,
    #doeQuickViewModal .modal-dialog-scrollable .modal-body {
        overflow: visible;
    }
    #logHeatModal .modal-header,
    #animalLogHeatModal .modal-header,
    #doeQuickViewModal .modal-header {
        position: sticky;
        top: 0;
        z-index: 3;
        background: #212529;
    }
    .heat-modal-more {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 4;
        padding: 28px 0 12px;
        pointer-events: none;
        text-align: center;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #d1d5db;
        background: linear-gradient(to bottom, rgba(33, 37, 41, 0), #212529 62%);
        border-radius: 0 0 var(--bs-border-radius-lg, 0.5rem) var(--bs-border-radius-lg, 0.5rem);
    }
    .heat-modal-more i {
        display: block;
        margin-top: 2px;
        font-size: 0.8rem;
        color: #00e2ff;
    }
    .heat-modal--more .heat-modal-more {
        display: block;
    }

    /* Bucks on Ice inventory + tank sheets: same whole-sheet scroll + More cue. */
    #inventoryModal .modal-dialog,
    #tankModal .modal-dialog {
        margin: 8px auto;
        max-width: calc(100vw - 16px);
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }
    #inventoryModal .modal-dialog-scrollable,
    #tankModal .modal-dialog-scrollable {
        height: auto;
        max-height: calc(100dvh - 16px);
    }
    #inventoryModal .modal-dialog-scrollable .modal-content,
    #tankModal .modal-dialog-scrollable .modal-content {
        max-height: calc(100dvh - 16px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #inventoryModal .modal-dialog-scrollable .modal-body,
    #tankModal .modal-dialog-scrollable .modal-body {
        overflow: visible;
    }
    #inventoryModal .modal-header,
    #tankModal .modal-header {
        position: sticky;
        top: 0;
        z-index: 3;
        background: #212529;
    }
}

/* Record detail: keep the sheet on screen and show the same More cue
   while notes or the action buttons are still below the fold. */
#recordModal .modal-dialog,
#addReminderModal .modal-dialog {
    margin: 12px auto;
    max-height: calc(100dvh - 24px);
}
#recordModal .modal-dialog-scrollable,
#addReminderModal .modal-dialog-scrollable {
    height: auto;
    max-height: calc(100dvh - 24px);
}
#recordModal .modal-content,
#addReminderModal .modal-content {
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
#recordModal .modal-body,
#addReminderModal .modal-body {
    overflow: visible;
}
#recordModal .modal-header,
#addReminderModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #212529;
}
#recordModal .heat-modal-more,
#addReminderModal .heat-modal-more {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 28px 0 12px;
    pointer-events: none;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #d1d5db;
    background: linear-gradient(to bottom, rgba(33, 37, 41, 0), #212529 62%);
    border-radius: 0 0 var(--bs-border-radius-lg, 0.5rem) var(--bs-border-radius-lg, 0.5rem);
}
#recordModal .heat-modal-more i,
#addReminderModal .heat-modal-more i {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    color: #00e2ff;
}
#recordModal.heat-modal--more .heat-modal-more,
#addReminderModal.heat-modal--more .heat-modal-more {
    display: block;
}

/* iOS Safari sizes a filled-in date input to its native control and ignores
   width: 100%, so Edit (which fills the dates) ran the fields to the screen
   edge while Add kept its padding. Plain appearance lets it follow the form. */
@media (max-width: 575px) {
    #addRecordModal input[type="date"],
    #addReminderModal input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    #addRecordModal input[type="date"]::-webkit-date-and-time-value,
    #addReminderModal input[type="date"]::-webkit-date-and-time-value {
        text-align: left;
        min-height: 1.5em;  /* keeps an empty date the same height as a filled one */
    }
}


/* ----------------------------------------------------------------------
   Notice modal
   Used by the ADGA certificate extractor to confirm what it filled in, and
   to report a file it could not read. Same shape as .heat-gap-modal above,
   with the accent bar and icon switching between the ok and error states.
   ---------------------------------------------------------------------- */
.modal-content.pp-notice-modal {
    background: var(--pp-surface);
    color: var(--pp-ink);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius);
    box-shadow: inset 4px 0 0 var(--pp-ok), var(--pp-shadow-lg);
}
.modal-content.pp-notice-modal.is-error {
    box-shadow: inset 4px 0 0 var(--pp-danger), var(--pp-shadow-lg);
}
.modal-content.pp-notice-modal .modal-header,
.modal-content.pp-notice-modal .modal-body,
.modal-content.pp-notice-modal .modal-footer {
    background: transparent;
    color: inherit;
}
.modal-content.pp-notice-modal .modal-header {
    border-bottom-color: var(--pp-line);
}
.modal-content.pp-notice-modal .modal-footer {
    border-top-color: var(--pp-line);
    justify-content: flex-end;
}
.modal-content.pp-notice-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--pp-ink);
}
.pp-notice-modal__icon {
    color: var(--pp-ok);
    font-size: 1.05em;
}
.modal-content.pp-notice-modal.is-error .pp-notice-modal__icon {
    color: var(--pp-danger);
}
.modal-content.pp-notice-modal .modal-body {
    line-height: 1.55;
    color: #3f3f46;
}
.modal-content.pp-notice-modal .modal-header .btn-close {
    filter: none;
}


/* ----------------------------------------------------------------------
   Light modal
   The animal profile page themes every .modal-content dark, so a dialog
   shared with another page renders differently depending on where it is
   opened. Shared dialogs opt into this class to look the same everywhere.
   ---------------------------------------------------------------------- */
.modal-content.pp-modal-light {
    background-color: var(--pp-surface);
    color: var(--pp-ink);
    border: 1px solid var(--pp-line);
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-shadow-lg);
}
.modal-content.pp-modal-light .modal-header,
.modal-content.pp-modal-light .modal-footer {
    background-color: transparent;
    border-color: var(--pp-line);
}
.modal-content.pp-modal-light .modal-body {
    background-color: transparent;
    color: #3f3f46;
    line-height: 1.55;
}
.modal-content.pp-modal-light .modal-title {
    color: var(--pp-ink);
    font-weight: 700;
}
.modal-content.pp-modal-light .modal-header .btn-close {
    filter: none;
}

/* Updated Terms of Service prompt (base.html). Dark card to match the app
   header, cyan accent. Not dismissible, so there is no close button. */
.modal-content.terms-modal {
    align-items: center;
    text-align: center;
    padding: 32px 28px 24px;
    background: linear-gradient(180deg, #121a24 0%, #0b0f14 100%);
    color: #e6e9ef;
    border: 1px solid rgba(0, 226, 255, .22);
    border-radius: 20px;
    box-shadow: 0 0 0 1px rgba(0, 226, 255, .06), 0 24px 64px rgba(0, 0, 0, .55);
}
.terms-modal__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: rgba(0, 226, 255, .12);
    color: var(--pp-cyan);
    font-size: 1.4rem;
    box-shadow: 0 0 24px rgba(0, 226, 255, .18);
}
.terms-modal__title {
    margin: 0 0 10px;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
}
.terms-modal__text {
    margin: 0 0 16px;
    max-width: 380px;
    color: #aab3c0;
    font-size: .95rem;
    line-height: 1.6;
}
.terms-modal__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
}
.terms-modal__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pp-cyan);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: color .2s var(--pp-ease);
}
.terms-modal__link i { font-size: .75em; }
.terms-modal__link:hover { color: #7ff0ff; text-decoration: underline; }
.terms-modal__error {
    min-height: 1.2em;
    margin: 12px 0 0;
    color: #ff7b7b;
    font-size: .85rem;
}
.terms-modal__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}
.terms-modal__agree {
    width: 100%;
    max-width: 280px;
}
.terms-modal__agree:disabled { opacity: .6; cursor: wait; }
.terms-modal__logout {
    color: #7d8796;
    font-size: .85rem;
    text-decoration: none;
    transition: color .2s var(--pp-ease);
}
.terms-modal__logout:hover { color: #e6e9ef; }
.terms-modal__help {
    margin: 18px 0 0;
    padding-top: 14px;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: #7d8796;
    font-size: .8rem;
    line-height: 1.5;
}
.terms-modal__help a { color: var(--pp-cyan); text-decoration: none; }
.terms-modal__help a:hover { text-decoration: underline; }
/* ----------------------------------------------------------------------
   Bulk select
   Row checkboxes, the selection bar and selected-row tint for the record
   and reminder tables (/records, /reminders, Animal page). Behaviour lives
   in static/js/pp-bulk-select.js. Selected rows tint light purple on every
   table; the records selection bar stays red since Delete is its only action.
   ---------------------------------------------------------------------- */
.record-select,
.reminder-select,
.pp-select-all {
    width: 1.05rem;
    height: 1.05rem;
    cursor: pointer;
}

/* Checkbox and Notes columns shrink to their content so Title gets the room */
.table .pp-select-cell,
.table .pp-notes-cell {
    width: 1%;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .table .pp-select-cell,
    .table .pp-notes-cell {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* Animal page tables sit flush to the card edge, so give the checkbox room on desktop */
@media (min-width: 769px) {
    #recordsTable .pp-select-cell,
    #notificationsTable .pp-select-cell {
        padding-left: 1rem;
    }
}


.pp-selection-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 12px 8px;
    padding: 10px 16px;
    border-radius: 16px;
    background: #faf5ff;
    border: 1px solid #e4d4f7;
}
.pp-selection-bar.pp-selection-bar-danger {
    background: #fff5f5;
    border-color: #fecaca;
}
/* Count and buttons always share one line; buttons shrink on phones instead of stacking */
.pp-selection-bar > span { white-space: nowrap; }
.pp-selection-bar .selection-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}
.pp-selection-bar .btn,
.pp-selection-bar .pp-btn { white-space: nowrap; }

@media (max-width: 576px) {
    .pp-selection-bar {
        gap: 8px;
        padding: 8px 10px;
        font-size: 14px;
    }
    .pp-selection-bar .selection-actions { gap: 6px; }
    .pp-selection-bar .btn,
    .pp-selection-bar .pp-btn {
        padding: 5px 10px;
        font-size: 13px;
    }
}


/* ----------------------------------------------------------------------
   Add Record modal
   Shared by the Records page and the animal profile so both forms look
   the same. Moved here from records.html.
   ---------------------------------------------------------------------- */
#addRecordModal .modal-dialog {
    margin: 12px auto;
    max-height: calc(100dvh - 24px);
}
#addRecordModal .modal-dialog-scrollable {
    height: auto;
    max-height: calc(100dvh - 24px);
}
#addRecordModal .modal-content {
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
#addRecordModal .modal-body {
    overflow: visible;
    padding: 24px 28px;
}
#addRecordModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #212529;
}
#addRecordModal .modal-header,
#addRecordModal .modal-footer {
    border-color: #444;
}
#addRecordModal .heat-modal-more {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 28px 0 12px;
    pointer-events: none;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #d1d5db;
    background: linear-gradient(to bottom, rgba(33, 37, 41, 0), #212529 62%);
    border-radius: 0 0 15px 15px;
}
#addRecordModal .heat-modal-more i {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    color: #00e2ff;
}
#addRecordModal.heat-modal--more .heat-modal-more {
    display: block;
}
#addRecordModal .form-label,
#addRecordModal .pp-label,
#addRecordModal .form-check-label {
    color: #fff;
}
#addRecordModal .pp-required,
#addRecordModal .form-label + small,
#addRecordModal small {
    color: #b1b1b1;
}
#addRecordModal .add-record-note[hidden],
#addRecordModal #editBreedingNote[hidden] {
    display: none;
}
#addRecordModal .add-record-note {
    display: flex;
    gap: 12px;
    border-radius: 14px;
    padding: 13px 16px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    background: #0c3d4a;
    border: 1px solid #176b7f;
    color: #d3f6ff;
}
#addRecordModal .add-record-note a {
    color: #00e2ff;
}
#addRecordModal .record-recurring-note {
    background: #3d2e14;
    border-color: #8a6230;
    color: #f6e2c4;
}
#addRecordModal .form-control,
#addRecordModal .form-select {
    background-color: #434343;
    color: #fff;
    border: none;
    border-radius: 15px;
    padding: 12px 15px;
    box-shadow: 0 0 8px #00e2ff;
    color-scheme: dark;
}
#addRecordModal .form-select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300e2ff' d='M1.2 1.2L6 6l4.8-4.8L12 2.4 6 8.4 0 2.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 38px;
}
#addRecordModal .form-select:has(option[value=""]:checked) {
    color: #9a9a9a;
}
#addRecordModal .form-select option {
    background-color: #434343;
    color: #fff;
}
#addRecordModal .form-control:focus,
#addRecordModal .form-select:focus {
    background-color: #434343;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 12px #00e2ff;
}
#addRecordModal input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
}
#addRecordModal .ms-control {
    background: #434343;
    border: none;
    border-radius: 15px;
    box-shadow: 0 0 8px #00e2ff;
    color: #fff;
}
#addRecordModal .ms-placeholder,
#addRecordModal .ms-caret {
    color: #b1b1b1;
}
#addRecordModal .ms-panel {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}
#addRecordModal .ms-panel__head,
#addRecordModal .ms-panel__foot {
    border-color: #444;
    background: #2a2a2a;
}
#addRecordModal .ms-search input {
    background: #434343;
    color: #fff;
    border-color: #555;
}
#addRecordModal .ms-opt {
    color: #fff;
}
#addRecordModal .ms-opt:hover,
#addRecordModal .ms-opt[aria-selected="true"] {
    background: #3a3a3a;
}
#addRecordModal .ms-opt__name {
    color: #fff;
}
#addRecordModal .ms-count,
#addRecordModal .ms-count b,
#addRecordModal .ms-section {
    color: #d1d5db;
}

/* ----------------------------------------------------------------------
   Add Reminder modal
   Shared by the Reminders page and the animal profile. The scroll shell
   rules live with #recordModal above. Moved here from reminders.html.
   ---------------------------------------------------------------------- */
#addReminderModal .modal-header,
#addReminderModal .modal-footer {
    border-color: #444;
}
#addReminderModal .modal-body {
    padding: 24px 28px;
}
#addReminderModal .form-label,
#addReminderModal .form-check-label {
    color: #fff;
}
#addReminderModal .pp-required,
#addReminderModal .form-label + small,
#addReminderModal small {
    color: #b1b1b1;
}
#addReminderModal .add-record-note[hidden],
#addReminderModal #editReminderBreedingNote[hidden] {
    display: none;
}
#addReminderModal .add-record-note {
    display: flex;
    gap: 12px;
    border-radius: 14px;
    padding: 13px 16px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    background: #0c3d4a;
    border: 1px solid #176b7f;
    color: #d3f6ff;
}
#addReminderModal .add-record-note a {
    color: #00e2ff;
}
#addReminderModal .form-control,
#addReminderModal .form-select {
    background-color: #434343;
    color: #fff;
    border: none;
    border-radius: 15px;
    box-shadow: 0 0 8px #00e2ff;
}
#addReminderModal .form-select option {
    color: #000;
}
#addReminderModal .form-control:focus,
#addReminderModal .form-select:focus {
    background-color: #434343;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 12px #00e2ff;
}
#addReminderModal input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
}
#addReminderModal .ms-control {
    background: #434343;
    border: none;
    border-radius: 15px;
    box-shadow: 0 0 8px #00e2ff;
    color: #fff;
}
#addReminderModal .ms-placeholder,
#addReminderModal .ms-caret {
    color: #b1b1b1;
}
#addReminderModal .ms-panel {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}
#addReminderModal .ms-panel__head,
#addReminderModal .ms-panel__foot {
    border-color: #444;
    background: #2a2a2a;
}
#addReminderModal .ms-search input {
    background: #434343;
    color: #fff;
    border-color: #555;
}
#addReminderModal .ms-opt {
    color: #fff;
}
/* Group chips use the secondary brand purple so they stand apart from the
   cyan-themed form and the light-grey individual animal chips. */
#addRecordModal .ms-chip--group,
#addReminderModal .ms-chip--group {
    background: var(--pp-purple);
    color: #fff;
    box-shadow: 0 2px 8px rgba(157, 0, 244, .35);
}
#addRecordModal .ms-chip--group .ms-chip__av,
#addReminderModal .ms-chip--group .ms-chip__av {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}
#addRecordModal .ms-opt--group .ms-opt__av,
#addReminderModal .ms-opt--group .ms-opt__av {
    background: rgba(157, 0, 244, .3);
    color: #e2b8ff;
}
#addRecordModal .ms-opt__meta,
#addReminderModal .ms-opt__meta {
    color: #b1b1b1;
}
#addRecordModal .ms-chip--group .ms-chip__x,
#addReminderModal .ms-chip--group .ms-chip__x {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}
#addRecordModal .ms-chip--group .ms-chip__x:hover,
#addReminderModal .ms-chip--group .ms-chip__x:hover {
    background: var(--pp-warn-soft);
    color: var(--pp-warn);
}
#addReminderModal .form-check-input {
    background-color: #434343;
    border-color: #888;
}
#addReminderModal .form-check-input:checked {
    background-color: #00e2ff;
    border-color: #00e2ff;
}

/* ============================================================
   Photo crop popup (pp-photo-crop.js)
   Square crop for animal profile photos.
   ============================================================ */
.pp-crop-open { overflow: hidden; }

.pp-crop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(10, 12, 16, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .2s var(--pp-ease);
}
.pp-crop.is-open { opacity: 1; }

.pp-crop__card {
    width: min(100%, 400px);
    padding: 22px;
    background: var(--pp-surface);
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-shadow-lg);
    transform: translateY(8px) scale(.98);
    transition: transform .25s var(--pp-ease);
}
.pp-crop.is-open .pp-crop__card { transform: none; }

.pp-crop__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pp-ink);
}
.pp-crop__hint {
    margin: 4px 0 16px;
    font-size: .875rem;
    color: var(--pp-muted);
}

.pp-crop__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--pp-radius-sm);
    background: #f1f3f5;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.pp-crop__stage.is-dragging { cursor: grabbing; }

.pp-crop__img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    transform-origin: 0 0;
    pointer-events: none;
}

/* Rule-of-thirds guide, visible only while repositioning. */
.pp-crop__grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
    background-image:
        linear-gradient(to right, transparent calc(33.333% - .5px), rgba(255, 255, 255, .55) calc(33.333% - .5px), rgba(255, 255, 255, .55) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255, 255, 255, .55) calc(66.666% - .5px), rgba(255, 255, 255, .55) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
        linear-gradient(to bottom, transparent calc(33.333% - .5px), rgba(255, 255, 255, .55) calc(33.333% - .5px), rgba(255, 255, 255, .55) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255, 255, 255, .55) calc(66.666% - .5px), rgba(255, 255, 255, .55) calc(66.666% + .5px), transparent calc(66.666% + .5px));
    opacity: 0;
    transition: opacity .2s var(--pp-ease);
}
.pp-crop__stage.is-dragging .pp-crop__grid { opacity: 1; }

.pp-crop__zoom {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 20px;
    color: var(--pp-muted);
}
.pp-crop__zoom input { flex: 1; accent-color: var(--pp-cyan); }
.pp-crop__zoom-icon { font-size: 1.05rem; }
.pp-crop__zoom-icon--sm { font-size: .75rem; }

.pp-crop__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
