* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7f8;
    color: #202426;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

a {
    color: #0b6f72;
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px 18px 48px;
}

.topbar {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.topbar h1 {
    font-size: 30px;
    line-height: 1.1;
    margin: 0;
}

.subtitle {
    color: #556064;
    margin: 6px 0 0;
}

.button,
button {
    background: #0b6f72;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 700;
    padding: 10px 14px;
    text-align: center;
}

.button:hover,
button:hover {
    background: #095b5e;
    text-decoration: none;
}

.button.secondary {
    background: #ffffff;
    border: 1px solid #cbd5d8;
    color: #202426;
}

.button.compact {
    padding: 7px 10px;
}

.auth-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    justify-content: flex-end;
    margin: -8px 0 22px;
}

.auth-nav form {
    margin: 0;
}

.auth-user {
    color: #596468;
    font-size: 14px;
    font-weight: 700;
}

.link-button {
    background: transparent;
    border: 0;
    color: #0b6f72;
    font: inherit;
    font-weight: 700;
    padding: 0;
}

.link-button:hover {
    background: transparent;
    text-decoration: underline;
}

.auth-shell {
    max-width: 720px;
}

.auth-panel {
    margin: 24px auto;
    max-width: 520px;
}

.auth-panel h1 {
    margin: 0 0 6px;
}

.auth-switch {
    margin: 16px 0 0;
}

.helptext {
    color: #667175;
    display: block;
    font-size: 13px;
    margin-top: 4px;
}

.errorlist {
    background: #fff0ed;
    border: 1px solid #f0b9ad;
    border-radius: 6px;
    color: #8d2f20;
    margin: 0 0 10px;
    padding: 9px 12px 9px 28px;
}

.address-results {
    background: #ffffff;
    border: 1px solid #bac6c9;
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(24, 35, 38, 0.14);
    display: grid;
    gap: 4px;
    margin-top: 6px;
    max-height: 220px;
    overflow: auto;
    padding: 6px;
}

.address-result {
    background: #ffffff;
    border: 0;
    border-radius: 4px;
    color: #202426;
    font-weight: 600;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.address-result:hover {
    background: #eef7f7;
}

.address-result-note {
    color: #596468;
    margin: 0;
    padding: 8px 10px;
}

.message {
    background: #e9f7ef;
    border: 1px solid #b9e2c9;
    border-radius: 6px;
    margin: 0 0 14px;
    padding: 10px 12px;
}

.notice {
    background: #fff7dd;
    border: 1px solid #ead27b;
    border-radius: 6px;
    color: #705600;
    margin: 0 0 14px;
    padding: 10px 12px;
}

.filter-panel {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 14px;
}

.filter-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(140px, 1fr)) auto;
}

.filter-field label {
    color: #687377;
    font-size: 12px;
    text-transform: uppercase;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.map-filter-form {
    grid-template-columns: repeat(3, minmax(160px, 240px)) auto;
    justify-content: start;
}

.dog-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.dog-card {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
}

.dog-photo,
.dog-photo-placeholder {
    aspect-ratio: 4 / 3;
    background: #dfe8ea;
    display: block;
    object-fit: cover;
    width: 100%;
}

.dog-photo-placeholder {
    align-items: center;
    color: #667175;
    display: flex;
    font-weight: 700;
    justify-content: center;
}

.detail-photo-placeholder {
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    margin-bottom: 14px;
}

[hidden] {
    display: none !important;
}

.dog-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.dog-card h2 {
    font-size: 21px;
    line-height: 1.15;
    margin: 0;
}

.meta {
    color: #596468;
    font-size: 14px;
    margin: 0;
}

.quick-facts {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
}

.fact {
    background: #f4f7f7;
    border-radius: 6px;
    padding: 8px;
}

.fact-label {
    color: #687377;
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.fact-value {
    display: block;
    font-size: 14px;
    margin-top: 2px;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.badge {
    background: #eef3f4;
    border: 1px solid #d8e0e2;
    border-radius: 999px;
    color: #2f3a3d;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 9px;
}

.badge.urgent {
    background: #fff0ed;
    border-color: #f0b9ad;
    color: #9d2f1e;
}

.badge.needed {
    background: #fff7dd;
    border-color: #ead27b;
    color: #705600;
}

.badge.paid {
    background: #e9f7ef;
    border-color: #b9e2c9;
    color: #226a3a;
}

.badge.unpaid {
    background: #fff7dd;
    border-color: #ead27b;
    color: #705600;
}

.badge.confirmed {
    background: #e9f7ef;
    border-color: #b9e2c9;
    color: #226a3a;
}

.badge.unconfirmed {
    background: #eef3f4;
    border-color: #d8e0e2;
    color: #596468;
}

.badge.archived {
    background: #f0f1f2;
    border-color: #c5cbce;
    color: #485156;
}

.card-actions {
    margin-top: auto;
}

.contact-box {
    background: #eef8f8;
    border: 1px solid #c9e2e3;
    border-radius: 6px;
    padding: 9px;
}

.contact-box p {
    margin: 3px 0;
    overflow-wrap: anywhere;
}

.empty-state {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    padding: 22px;
}

.detail-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.dashboard-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 380px;
}

.dashboard-jump-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.dashboard-jump-nav a {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 999px;
    color: #2f3a3d;
    padding: 7px 11px;
}

.dashboard-jump-nav a:hover {
    background: #eef8f8;
    text-decoration: none;
}

.dashboard-section {
    scroll-margin-top: 20px;
}

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

.activity-card {
    border: 1px solid #e1e7e9;
    border-radius: 8px;
    padding: 12px;
}

.compact-panel {
    max-height: 360px;
    overflow: auto;
}

.stat-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: 22px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    padding: 16px;
}

.stat-label {
    color: #687377;
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    margin-top: 6px;
}

.section-header,
.case-row-title,
.row-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.section-header h2,
.case-row-title h3 {
    margin: 0;
}

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

.case-row {
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: 116px minmax(0, 1fr);
    overflow: hidden;
    padding: 10px;
}

.case-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    height: 116px;
    object-fit: cover;
    width: 116px;
}

.case-thumb.placeholder {
    align-items: center;
    background: #dfe8ea;
    color: #667175;
    display: flex;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
}

.case-row-body {
    display: grid;
    gap: 8px;
}

.row-actions {
    justify-content: flex-start;
}

.activity-item {
    border-top: 1px solid #e1e7e9;
    padding: 12px 0;
}

.activity-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.activity-item p {
    margin: 4px 0;
}

.inline-action {
    margin-top: 8px;
}

.inline-action input[type="hidden"] {
    display: none;
}

.pledge-item p,
.help-offer-item p {
    margin: 5px 0;
}

.update-form {
    border-bottom: 1px solid #e1e7e9;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    gap: 10px;
    grid-template-columns: 14px minmax(0, 1fr);
}

.timeline-marker {
    background: #0b6f72;
    border-radius: 999px;
    height: 10px;
    margin-top: 9px;
    width: 10px;
}

.timeline-content {
    border-bottom: 1px solid #e1e7e9;
    padding-bottom: 14px;
}

.timeline-item:last-child .timeline-content {
    border-bottom: 0;
    padding-bottom: 0;
}

.timeline-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-content h3 {
    font-size: 18px;
    margin: 8px 0 4px;
}

.timeline-content p {
    margin: 4px 0;
}

.panel {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 18px;
}

.case-photo {
    border-radius: 8px;
    max-width: 100%;
}

form p {
    margin: 0 0 12px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
}

input,
select,
textarea {
    border: 1px solid #bac6c9;
    border-radius: 6px;
    font: inherit;
    max-width: 100%;
    padding: 9px 10px;
    width: 100%;
}

input[type="checkbox"] {
    margin-right: 7px;
    width: auto;
}

@media (max-width: 760px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .auth-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-layout,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .case-row {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .case-thumb {
        height: 88px;
        width: 88px;
    }
}
