.dogs-view.hidden {
    display: none;
}

body.dogs-tab-active #tab-notes {
    display: none !important;
}

.dogs-view {
    margin-bottom: 24px;
}

.dogs-view-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.dogs-view-title {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.dogs-view-subtitle {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 0.86rem;
}

.dogs-grid {
    --dog-card-height: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dogs-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 36px 16px;
    border: 1px dashed rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    color: #94a3b8;
    text-align: center;
}

.dogs-empty p {
    margin: 0;
}

/* ---------- Box ---------- */
.dog-card {
    display: flex;
    height: var(--dog-card-height);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.dog-card-media {
    position: relative;
    flex: 0 0 var(--dog-card-height);
    width: var(--dog-card-height);
    height: var(--dog-card-height);
    background: #0f172a;
}

.dog-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    height: 100%;
}

.dog-card-header {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    flex-wrap: wrap;
}

.dog-card-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.dog-card-columns {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.6fr);
    gap: 18px;
}

.dog-card-columns.no-info {
    grid-template-columns: minmax(0, 1fr);
}

.dog-card-info {
    min-height: 0;
    overflow-y: auto;
    padding-right: 14px;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.dog-card-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dog-card-photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #b45309 0%, #78350f 55%, #1c1917 100%);
}

.dog-card-photo--empty span {
    font-size: 4.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: -0.04em;
}

.dog-card-media-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 16px 12px;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.85) 100%);
}

.dog-card-name {
    margin: 0;
    color: #f8fafc;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.dog-card-breed {
    color: #94a3b8;
    font-size: 0.88rem;
}

.dog-card-edit {
    margin-left: auto;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.6);
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dog-card-edit:hover {
    background: rgba(51, 65, 85, 0.85);
    color: #fff;
}

.dog-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 16px;
}

.dog-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dog-chip {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 600;
}

.dog-chip--macho {
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
}

.dog-chip--femea {
    background: rgba(244, 114, 182, 0.14);
    color: #f9a8d4;
}

.dog-chip--ok {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.dog-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dog-info-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
    font-size: 0.84rem;
}

.dog-info-label {
    color: #64748b;
}

.dog-info-value {
    color: #e2e8f0;
    word-break: break-word;
    white-space: pre-line;
}

.dog-info-value a {
    color: #7dd3fc;
}

.dog-info-row.is-warn .dog-info-value {
    color: #fca5a5;
}

.dog-info-row.is-notes .dog-info-value {
    color: #94a3b8;
}

.dog-tasks {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding-top: 12px;
}

.dog-tasks-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dog-tasks-title {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dog-tasks-count {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    font-size: 0.72rem;
    text-align: center;
}

.dog-tasks-done {
    color: #64748b;
    font-size: 0.76rem;
}

.dog-task-add {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dog-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dog-task {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 9px 12px 9px 14px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.5);
    box-shadow: inset 3px 0 0 var(--priority-color, #38bdf8);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dog-task:hover {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(148, 163, 184, 0.22);
}

.dog-task-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.dog-task-title {
    flex: 1;
    min-width: 0;
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dog-task-due {
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.dog-task-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    color: #94a3b8;
    font-size: 0.76rem;
}

.dog-task-priority {
    font-weight: 700;
}

.dog-task-sep {
    color: #475569;
}

.dog-task-progress {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
}

.dog-task-progress-bar {
    width: 60px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.dog-task-progress-bar span {
    display: block;
    height: 100%;
    background: #22c55e;
}

.dog-task-excerpt {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dog-task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dog-task-tag {
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--tag-color, #64748b) 45%, transparent);
    background: color-mix(in srgb, var(--tag-color, #64748b) 14%, transparent);
    color: #cbd5e1;
    font-size: 0.7rem;
}

.dog-task-due.is-today {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.14);
    font-weight: 700;
}

.dog-task-due.is-overdue {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.14);
    font-weight: 700;
}

.dog-task-more,
.dog-task-empty {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.8rem;
}

.dog-task-empty {
    margin-top: 0;
}

.dog-task-empty strong {
    color: #cbd5e1;
}

/* ---------- Abas internas do box ---------- */
.dog-sections {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dog-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    padding: 3px;
    border-radius: 11px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.dog-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 7px 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.dog-tab:hover {
    color: #e2e8f0;
}

.dog-tab.is-active {
    background: rgba(51, 65, 85, 0.85);
    color: #f8fafc;
}

.dog-tab-count {
    min-width: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 0.68rem;
    line-height: 17px;
    text-align: center;
}

.dog-section-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.dog-panel-head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-bottom: 2px;
    background: rgba(15, 23, 42, 0.96);
}

.dog-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dog-panel-summary {
    color: #94a3b8;
    font-size: 0.8rem;
    min-width: 0;
}

.dog-panel-add {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dog-event-list,
.dog-med-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Consultas e exames */
.dog-event {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 8px 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(30, 41, 59, 0.5);
    transition: border-color 0.15s ease;
}

.dog-event:hover {
    border-color: rgba(148, 163, 184, 0.24);
}

.dog-event-check {
    display: inline-flex;
    padding-top: 2px;
    cursor: pointer;
}

.dog-event-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #22c55e;
    cursor: pointer;
}

.dog-event-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dog-event-title {
    color: #f1f5f9;
    font-size: 0.87rem;
    font-weight: 600;
    word-break: break-word;
}

.dog-event.is-done .dog-event-title {
    color: #94a3b8;
    text-decoration: line-through;
    text-decoration-color: rgba(148, 163, 184, 0.5);
}

.dog-event-meta {
    color: #94a3b8;
    font-size: 0.75rem;
}

.dog-event-flag.is-today {
    color: #fbbf24;
    font-weight: 700;
}

.dog-event-flag.is-overdue {
    color: #f87171;
    font-weight: 700;
}

.dog-event-notes {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.35;
    white-space: pre-line;
}

.dog-event-result {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    text-decoration: none;
}

.dog-event-result:hover {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.6);
}

.dog-event-result.has-file {
    border-style: solid;
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

/* Remédios */
.dog-med-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(30, 41, 59, 0.5);
    box-shadow: inset 3px 0 0 var(--med-color, #64748b);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.dog-med-main:hover {
    border-color: rgba(148, 163, 184, 0.24);
}

.dog-med--active { --med-color: #22c55e; }
.dog-med--scheduled { --med-color: #38bdf8; }
.dog-med--finished { --med-color: #475569; }

.dog-med-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dog-med-name {
    flex: 1;
    min-width: 0;
    color: #f1f5f9;
    font-size: 0.88rem;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dog-med-status {
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--med-color);
    background: rgba(148, 163, 184, 0.1);
}

.dog-med--finished .dog-med-name {
    color: #94a3b8;
}

.dog-med-dosage {
    color: #cbd5e1;
    font-size: 0.8rem;
}

.dog-med-meta {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* ---------- Formulário ---------- */
.dog-modal-subtitle {
    margin: 2px 0 0;
    color: #94a3b8;
    font-size: 0.84rem;
}

.dog-result-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dog-result-field > span {
    color: #94a3b8;
    font-size: 0.82rem;
}

.dog-result-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.dog-result-row .ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dog-result-current {
    color: #86efac;
    font-size: 0.85rem;
    word-break: break-all;
}

.dog-result-current[hidden],
.dog-result-pending[hidden],
.dog-result-row .ghost-btn[hidden] {
    display: none;
}

.dog-result-pending {
    color: #fbbf24;
    font-size: 0.82rem;
    word-break: break-all;
}

.dog-hint {
    color: #64748b;
    font-size: 0.75rem;
}

.dog-form-grid input:disabled {
    opacity: 0.45;
}
.dog-dialog {
    width: min(640px, calc(100vw - 24px));
    max-width: min(640px, calc(100vw - 24px));
}

.dog-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dog-form-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dog-photo-picker {
    position: relative;
    width: 140px;
    height: 140px;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px dashed rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.dog-photo-picker:hover {
    border-color: rgba(96, 165, 250, 0.6);
}

.dog-photo-picker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dog-photo-picker img[hidden],
.dog-photo-placeholder[hidden] {
    display: none;
}

.dog-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    font-size: 0.8rem;
}

.dog-photo-placeholder svg {
    width: 26px;
    height: 26px;
}

.dog-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dog-form-grid label,
.dog-choice-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.dog-form-grid label > span,
.dog-choice-field > span {
    color: #94a3b8;
    font-size: 0.82rem;
}

.dog-form-grid .span-2 {
    grid-column: 1 / -1;
}

.dog-form-grid label.dog-check {
    flex-direction: row;
    align-items: center;
    align-self: end;
    gap: 8px;
    padding-bottom: 10px;
    cursor: pointer;
}

.dog-form-grid label.dog-check span {
    color: #e2e8f0;
    font-size: 0.9rem;
}

.dog-check input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.dog-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dog-choice {
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.6);
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dog-choice:hover {
    border-color: rgba(148, 163, 184, 0.4);
}

.dog-choice.is-active {
    border-color: rgba(96, 165, 250, 0.7);
    background: rgba(37, 99, 235, 0.22);
    color: #fff;
}

.dog-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.dog-delete-btn {
    margin-right: auto;
    color: #fca5a5;
}

.dog-delete-btn[hidden] {
    display: none;
}

@media (max-width: 1180px) {
    .dogs-grid {
        --dog-card-height: 340px;
    }

    .dog-card-columns {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 10px;
    }

    .dog-card-info {
        max-height: 92px;
        padding-right: 6px;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12);
        padding-bottom: 8px;
    }
}

@media (max-width: 760px) {
    .dog-card {
        flex-direction: column;
        height: auto;
    }

    .dog-card-media {
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        max-height: 420px;
    }

    .dog-card-content {
        height: auto;
    }

    .dog-card-columns {
        grid-template-rows: auto;
    }

    .dog-card-info {
        max-height: none;
    }

    .dog-section-panel {
        max-height: 420px;
    }
}

@media (max-width: 560px) {
    .dog-form-grid {
        grid-template-columns: 1fr;
    }
}
