.pedigree-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px 0 16px;
    border-bottom: 1px solid #cfd8dc;
}

.pedigree-toolbar .pedigree-title {
    font-weight: 600;
    font-size: 1.5rem;
    color: #263238;
    margin-top: 4px;
}

.pedigree-toolbar .pedigree-note {
    display: block;
    color: #546e7a;
    font-size: 13px;
    margin-top: 2px;
}

.pedigree-toolbar-actions {
    white-space: nowrap;
}

.pedigree-toolbar-actions .btn,
.pedigree-toolbar .btn {
    width: auto !important;
    margin-left: 6px;
}

.pedigree-wrap {
    overflow-x: auto;
    padding-bottom: 12px;
}

.ped-node {
    display: flex;
    align-items: stretch;
}

.ped-parents {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.ped-card {
    width: 168px;
    min-height: 72px;
    margin: 4px 8px 4px 0;
    padding: 8px;
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    line-height: 1.3;
}

.ped-card.sire {
    background: #e8f4fc;
    border-color: #90caf9;
}

.ped-card.dam {
    background: #fce8f0;
    border-color: #f48fb1;
}

.ped-card.empty {
    background: #fafafa;
    border-style: dashed;
    color: #90a4ae;
}

.ped-card .ped-name {
    font-weight: 600;
    display: block;
}

.ped-card .ped-meta {
    color: #607d8b;
    font-size: 11px;
}

.ped-card img {
    max-height: 36px;
    margin-bottom: 4px;
}

.ped-actions {
    margin-top: 6px;
}

.ped-actions .btn {
    padding: 2px 8px;
    font-size: 11px;
}

.coi-panel {
    margin-top: 16px;
}

.coi-panel table {
    font-size: 13px;
}

.coi-disclaimer {
    font-size: 12px;
    color: #607d8b;
}

.add-ancestor-panel {
    display: none;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #eceff1;
    background: #fafafa;
}

.search-hits {
    margin-top: 8px;
}

.search-hit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.badge-pedigree-only {
    background: #eceff1;
    color: #546e7a;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

.whelp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px 0 16px;
    border-bottom: 1px solid #cfd8dc;
}

.whelp-title {
    font-weight: 600;
    font-size: 1.5rem;
    color: #263238;
    margin-top: 4px;
}

.whelp-meta {
    color: #546e7a;
    font-size: 13px;
    margin-top: 2px;
}

.whelp-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.whelp-toolbar-actions .btn {
    width: auto !important;
}

.kennel-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #eceff1;
    color: #546e7a;
}

.kennel-status-whelping { background: #fff3e0; color: #e65100; }
.kennel-status-raising { background: #e8f5e9; color: #2e7d32; }
.kennel-status-listed { background: #e3f2fd; color: #1565c0; }
.kennel-status-planned { background: #f3e5f5; color: #6a1b9a; }
.kennel-status-closed { background: #eceff1; color: #607d8b; }

.whelp-log,
.whelp-notes,
.card-block {
    background: #fff;
    border: 1px solid #eceff1;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.whelp-sex-row {
    display: flex;
    gap: 8px;
}

.whelp-sex-btn {
    flex: 1;
    min-height: 48px;
    font-size: 1.05rem;
    border: 2px solid #cfd8dc;
    background: #fff;
}

.whelp-sex-btn.selected[data-sex="1"] {
    background: #e8f4fc;
    border-color: #1e88e5;
    color: #1565c0;
}

.whelp-sex-btn.selected[data-sex="2"] {
    background: #fce8f0;
    border-color: #ec407a;
    color: #ad1457;
}

.collar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.collar-chip {
    display: inline-block;
    padding: 8px 12px;
    min-height: 40px;
    border-radius: 20px;
    border: 2px solid rgba(0,0,0,.15);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #78909c;
}

.collar-chip.selected {
    box-shadow: 0 0 0 2px #263238;
}

.collar-chip-sm {
    min-height: 0;
    padding: 2px 8px;
    font-size: 12px;
    cursor: default;
    vertical-align: middle;
}

.collar-chip[data-collar="Red"] { background: #e53935; }
.collar-chip[data-collar="Blue"] { background: #1e88e5; }
.collar-chip[data-collar="Green"] { background: #43a047; }
.collar-chip[data-collar="Yellow"] { background: #fdd835; color: #333; }
.collar-chip[data-collar="Pink"] { background: #ec407a; }
.collar-chip[data-collar="Orange"] { background: #fb8c00; }
.collar-chip[data-collar="Purple"] { background: #8e24aa; }
.collar-chip[data-collar="Black"] { background: #212121; }
.collar-chip[data-collar="White"] { background: #fafafa; color: #333; border-color: #bdbdbd; }
.collar-chip[data-collar="Teal"] { background: #00897b; }

.whelp-weight-row {
    display: flex;
    gap: 12px;
}

.whelp-weight-row > div {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.whelp-unit {
    color: #607d8b;
    font-size: 13px;
}

.whelp-log-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
}

.whelp-list h5 {
    margin-bottom: 12px;
}

.whelp-pup {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #eceff1;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fff;
}

.whelp-pup-order {
    font-weight: 700;
    color: #90a4ae;
    min-width: 28px;
}

.whelp-pup-body {
    flex: 1;
}

.whelp-pup-sex,
.whelp-pup-color {
    color: #607d8b;
    font-size: 13px;
    margin-left: 6px;
}

.whelp-pup-meta {
    color: #546e7a;
    font-size: 13px;
    margin: 4px 0;
}

.whelp-placenta-label {
    font-weight: normal;
    font-size: 13px;
    margin: 0;
}

.whelp-pup-actions {
    white-space: nowrap;
}

.whelp-pup-actions .btn {
    width: auto !important;
}

.whelp-notes textarea {
    margin-bottom: 8px;
}

.whelp-notes .btn {
    width: auto !important;
}

.weights-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.weights-date-row .form-control {
    width: auto;
    max-width: 180px;
}

.weights-date-row .btn {
    width: auto !important;
}

.weights-grid {
    margin-bottom: 12px;
    border: 1px solid #eceff1;
    border-radius: 6px;
    overflow-x: auto;
    background: #fff;
}

.weights-table-head,
.weights-row {
    display: grid;
    grid-template-columns: minmax(110px, 1.4fr) minmax(72px, 0.8fr) 64px 64px minmax(90px, 1.4fr);
    align-items: center;
    column-gap: 8px;
    padding: 6px 10px;
    min-height: 40px;
}

.weights-table-head {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #78909c;
    background: #fafafa;
    border-bottom: 1px solid #eceff1;
}

.weights-row {
    border-bottom: 1px solid #f5f5f5;
}

.weights-row input[type="hidden"] {
    display: none;
}

.weights-row:last-child {
    border-bottom: 0;
}

.weights-row-flag {
    background: #fff8f8;
}

.weights-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weights-name .whelp-pup-sex {
    margin-left: 4px;
}

.weights-prev {
    font-size: 12px;
    color: #607d8b;
    white-space: nowrap;
}

.weights-input.form-control {
    width: 64px;
    height: 32px;
    padding: 4px 6px;
    max-width: 64px;
}

.weights-flag {
    color: #c62828;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weights-save {
    width: auto !important;
    margin-top: 8px;
}

.weights-hint {
    font-size: 12px;
    color: #607d8b;
    margin-top: 8px;
}

.weights-chart-wrap {
    margin-top: 16px;
    background: #fff;
    border: 1px solid #eceff1;
    border-radius: 6px;
    padding: 12px 16px 8px;
}

.weights-chart-wrap h5 {
    margin: 0 0 8px;
    font-size: 15px;
}

.weights-chart-box {
    position: relative;
    height: 200px;
    max-height: 200px;
}

.weights-chart-box canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 200px;
    display: block;
}

.heat-banner {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    color: #e65100;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.heat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.heat-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.heat-inline-form .form-control {
    width: auto;
    max-width: 180px;
}

.heat-inline-form .btn {
    width: auto !important;
}

.heat-diary-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.heat-diary-fields > div {
    min-width: 110px;
}

.heat-diary-notes {
    flex: 1 1 160px;
}

.heat-diary-fields .btn {
    width: auto !important;
}

.heat-diary-table {
    border: 1px solid #eceff1;
    border-radius: 6px;
    overflow-x: auto;
    background: #fff;
}

.heat-diary-head,
.heat-diary-row {
    display: grid;
    grid-template-columns: 90px 90px 90px 110px minmax(120px, 1fr);
    gap: 8px;
    padding: 6px 10px;
    align-items: center;
}

.heat-diary-head {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #78909c;
    background: #fafafa;
    border-bottom: 1px solid #eceff1;
}

.heat-diary-row {
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.heat-diary-row:last-child {
    border-bottom: 0;
}

.heat-history-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eceff1;
}

@media (max-width: 576px) {
    .whelp-pup {
        flex-wrap: wrap;
    }
    .whelp-pup-actions {
        width: 100%;
    }
    .whelp-pup-actions .btn {
        width: 100% !important;
    }
}

.portal-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    background: #fff;
}

.portal-card-img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.portal-card-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.portal-card-meta {
    color: #546e7a;
    font-size: 13px;
    margin-top: 2px;
}

.portal-card-actions {
    margin-top: 10px;
}

.portal-section {
    margin-bottom: 16px;
}

.portal-date-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-date-list li {
    padding: 6px 0;
    border-bottom: 1px solid #eceff1;
}

.portal-chat .single-conversation-wrapper {
    min-height: 420px;
    border: 1px solid #eceff1;
}

.portal-chat #messagesArea {
    height: 280px;
    overflow-y: auto;
}

.cal-pill,
.kennel-cal-event {
    display: block;
    padding: 1px 6px;
    margin: 0 0 3px 0;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.45;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #eceff1;
    color: #37474f;
    text-align: left;
}

.cal-delete-form {
    margin: 0;
    display: inline;
}

.kennel-cal {
    margin-bottom: 24px;
}

.kennel-cal-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 12px;
}

.kennel-cal-kicker {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #78909c;
    font-weight: 600;
}

.kennel-cal-month {
    font-size: 2rem;
    font-weight: 700;
    color: #1b2a4a;
    margin: 0;
    line-height: 1.15;
}

.kennel-cal-nav {
    display: flex;
    gap: 6px;
}

.kennel-cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #cfd8dc;
    border-radius: 18px;
    background: #fff;
    color: #37474f;
    font-weight: 600;
    text-decoration: none !important;
}

.kennel-cal-nav-btn:hover {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}

.kennel-cal-nav-today {
    min-width: 72px;
}

.kennel-cal-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #546e7a;
}

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

.kennel-cal-count {
    margin-left: auto;
    font-weight: 600;
    color: #1b2a4a;
}

.cal-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #90a4ae;
}

.cal-dot-heat, .kennel-cal-event-heat { background: #f8bbd0; color: #880e4f; }
.cal-dot-ovulation, .kennel-cal-event-ovulation { background: #e1bee7; color: #4a148c; }
.cal-dot-whelp, .kennel-cal-event-whelp { background: #ffe0b2; color: #e65100; }
.cal-dot-born, .kennel-cal-event-born { background: #c8e6c9; color: #1b5e20; }
.cal-dot-ready, .kennel-cal-event-ready { background: #bbdefb; color: #0d47a1; }
.cal-dot-pickup, .kennel-cal-event-pickup { background: #b2dfdb; color: #004d40; }
.cal-dot-custom, .kennel-cal-event-custom { background: #cfd8dc; color: #37474f; }

.kennel-cal-board {
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(27, 42, 74, 0.06);
    margin-bottom: 16px;
}

.kennel-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f4f7fb;
    border-bottom: 1px solid #e3e8ef;
}

.kennel-cal-weekdays div {
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #607d8b;
    text-align: center;
}

.kennel-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, minmax(108px, 1fr));
}

.kennel-cal-day {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 108px;
    padding: 8px 6px 6px;
    border-right: 1px solid #eef2f6;
    border-bottom: 1px solid #eef2f6;
    background: #fff;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.kennel-cal-day:nth-child(7n) {
    border-right: 0;
}

.kennel-cal-day.is-weekend {
    background: #fafbfd;
}

.kennel-cal-day.is-outside {
    background: #f7f9fc;
}

.kennel-cal-day.is-outside .kennel-cal-num {
    color: #b0bec5;
}

.kennel-cal-day.is-today .kennel-cal-num {
    background: #1565c0;
    color: #fff;
}

.kennel-cal-day.is-selected {
    background: #e8f1fc;
    box-shadow: inset 0 0 0 2px #1565c0;
}

.kennel-cal-day:hover {
    background: #f3f8ff;
}

.kennel-cal-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-bottom: 4px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: #263238;
}

.kennel-cal-events {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.kennel-cal-more {
    font-size: 11px;
    color: #78909c;
    padding-left: 4px;
}

.kennel-cal-side-card {
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(27, 42, 74, 0.05);
}

.kennel-cal-side-card h5 {
    font-weight: 700;
    margin-bottom: 12px;
}

.kennel-cal-side-event,
.kennel-cal-upcoming {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eceff1;
    font-size: 13px;
}

.kennel-cal-side-event .kennel-cal-event,
.kennel-cal-upcoming .kennel-cal-event {
    display: inline-block;
    width: auto;
    margin: 0;
}

.kennel-cal-upcoming-date {
    width: 52px;
    font-weight: 700;
    color: #1565c0;
}

@media (max-width: 768px) {
    .kennel-cal-month {
        font-size: 1.5rem;
    }
    .kennel-cal-grid {
        grid-template-rows: repeat(6, minmax(72px, 1fr));
    }
    .kennel-cal-day {
        min-height: 72px;
        padding: 4px 3px;
    }
    .kennel-cal-event {
        height: 8px;
        width: 8px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        margin: 0 2px 2px 0;
        display: inline-block;
    }
    .kennel-cal-events {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .portal-card {
        flex-direction: column;
    }
}
