:root {
    --portal-navy: #12343b;
    --portal-teal: #0f766e;
    --portal-sand: #f4c46a;
}

body {
    background: linear-gradient(180deg, #eef4f9 0%, #f8fbfd 48%, #ffffff 100%);
}

.portal-page {
    margin: 0 auto;
    max-width: 1320px;
    padding: 24px 18px 40px;
}

.status-banner {
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.status-success {
    background: #ecfdf5;
    border: 1px solid #ccebdd;
    color: #047857;
}

.status-error {
    background: #fff1f2;
    border: 1px solid #ffd0d6;
    color: #be123c;
}

.portal-hero {
    background: linear-gradient(135deg, var(--portal-navy), #0f5f55 58%, var(--portal-sand));
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(15, 52, 59, .18);
    color: #fff;
    margin-bottom: 18px;
    overflow: hidden;
    padding: 26px;
    position: relative;
}

.portal-hero::after {
    background: rgba(255, 255, 255, .10);
    border-radius: 999px;
    content: "";
    height: 240px;
    position: absolute;
    right: -72px;
    top: -88px;
    width: 240px;
}

.portal-top {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    position: relative;
    z-index: 1;
}

.portal-eyebrow {
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .14em;
    opacity: .82;
    text-transform: uppercase;
}

.portal-title {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.05;
    margin: 10px 0 12px;
    max-width: 760px;
}

.portal-copy {
    max-width: 760px;
    opacity: .92;
}

.portal-identity {
    align-items: center;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 22px;
    display: flex;
    gap: 14px;
    padding: 16px;
}

.portal-avatar {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 16px;
    height: 86px;
    object-fit: cover;
    width: 86px;
}

.portal-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.portal-metric {
    background: #fff;
    border: 1px solid #dbe7f3;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(12, 47, 59, .06);
    padding: 16px;
}

.portal-metric strong {
    color: var(--portal-teal);
    display: block;
    font-size: 1.7rem;
    line-height: 1;
}

.portal-mini {
    color: #6b8391;
    font-size: .8rem;
}

.portal-nav {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, .92);
    border: 1px solid #dde8f2;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(16, 59, 71, .08);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px;
    position: sticky;
    top: 16px;
    z-index: 30;
}

.portal-nav a {
    align-items: center;
    background: #f7fafc;
    border: 1px solid #e5edf5;
    border-radius: 999px;
    color: var(--portal-navy);
    display: inline-flex;
    font-size: .88rem;
    font-weight: 700;
    gap: 8px;
    padding: 10px 14px;
    text-decoration: none;
}

.portal-nav a:hover {
    border-color: var(--portal-teal);
    color: var(--portal-teal);
}

.portal-badge {
    background: #f4f8fb;
    border-radius: 999px;
    color: #355566;
    display: inline-flex;
    font-size: .76rem;
    font-weight: 700;
    padding: 6px 10px;
}

.portal-badge.ok {
    background: #ecfdf5;
    color: #047857;
}

.portal-badge.wait {
    background: #fff7e5;
    color: #9a6700;
}

.portal-card {
    background: #fff;
    border: 1px solid #dde8f2;
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(15, 52, 59, .06);
    margin-bottom: 18px;
    overflow: hidden;
}

.portal-card-head {
    align-items: center;
    border-bottom: 1px solid #e8eff6;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 16px 20px;
}

.portal-card-body {
    padding: 18px 20px 20px;
}

.portal-card-title {
    color: var(--portal-navy);
    font-size: 1.08rem;
    font-weight: 850;
}

.portal-card-subtitle {
    color: #64808d;
    font-size: .84rem;
    margin-top: 4px;
}

.portal-section-anchor {
    scroll-margin-top: 108px;
}

.portal-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.portal-hint {
    background: #f8fbff;
    border: 1px dashed #c7d8ea;
    border-radius: 16px;
    color: #57707e;
    margin-bottom: 14px;
    padding: 14px;
}

.portal-pets {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.portal-pet-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    border: 1px solid #dfeaf3;
    border-radius: 18px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.portal-pet-head {
    align-items: center;
    display: flex;
    gap: 12px;
}

.portal-processing {
    background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
    border: 1px solid #d7e6f3;
    border-radius: 20px;
    box-shadow: 0 16px 32px rgba(15, 52, 59, .06);
    display: none;
    gap: 14px;
    margin: 0 0 18px;
    padding: 18px;
}

.portal-processing.is-visible {
    display: grid;
}

.portal-processing-head {
    align-items: center;
    display: flex;
    gap: 14px;
}

.portal-processing-mark {
    align-items: center;
    background: radial-gradient(circle at 30% 30%, #143d46, #0e7490);
    border-radius: 18px;
    color: #fff;
    display: inline-flex;
    font-size: 1.3rem;
    font-weight: 900;
    height: 64px;
    justify-content: center;
    letter-spacing: .08em;
    width: 64px;
}

.portal-processing-head strong {
    color: var(--portal-navy);
    display: block;
    font-size: 1.02rem;
    margin-bottom: 4px;
}

.portal-processing-head p {
    color: #64808d;
    margin: 0;
}

.portal-progress {
    background: #dce8f4;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.portal-progress span {
    background: linear-gradient(90deg, #0ea5a4, #2563eb);
    border-radius: inherit;
    display: block;
    height: 100%;
    transition: width .35s ease;
}

.portal-processing-meta {
    color: #4b6471;
    display: flex;
    font-size: .84rem;
    font-weight: 700;
    justify-content: space-between;
}

.portal-processing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-pet-photo {
    background: #e6f4f1;
    border: 1px solid #d4e9e5;
    border-radius: 16px;
    height: 62px;
    object-fit: cover;
    width: 62px;
}

.portal-pet-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--portal-teal);
}

.portal-pet-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--portal-navy);
}

.portal-pet-meta {
    color: #6a808c;
    display: grid;
    gap: 4px;
    font-size: .82rem;
}

.portal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-table-wrap {
    overflow-x: auto;
}

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

.portal-inline {
    display: inline;
}

.portal-empty {
    background: #fbfdff;
    border: 1px dashed #d5e3ee;
    border-radius: 16px;
    color: #637b88;
    padding: 18px;
}

.portal-repo-group {
    border: 1px solid #e3edf5;
    border-radius: 18px;
    margin-bottom: 14px;
    overflow: hidden;
}

.portal-repo-group-head {
    align-items: center;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f8fc 100%);
    border-bottom: 1px solid #e6eff6;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 16px;
}

.portal-tutor-label {
    font-size: .78rem;
    opacity: .78;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.portal-tutor-name {
    font-size: 1.18rem;
    font-weight: 800;
    margin: 4px 0;
}

.portal-tutor-code {
    opacity: .9;
}

.portal-tutor-contact {
    opacity: .86;
}

.azpet-flex-center {
    display: flex;
    align-items: center;
}

.gap-12 {
    gap: 12px;
}

.mt-4 {
    margin-top: 4px;
}

.pt-14 {
    padding-top: 14px;
}
/* ===================== Modal de pré-visualização (portal público) ===================== */
.azpet-preview[hidden] { display: none; }
.azpet-preview { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.azpet-preview-backdrop { position: absolute; inset: 0; background: rgba(7, 24, 39, .55); }
.azpet-preview-card { position: relative; z-index: 1; width: min(920px, 100%); max-height: 90vh; display: flex; flex-direction: column; background: #fff; border: 1px solid #E6EDF2; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(7, 24, 39, .55); }
.azpet-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #EEF2F5; flex-wrap: wrap; }
.azpet-preview-name { font: 700 14px 'Plus Jakarta Sans', system-ui, sans-serif; color: #071827; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.azpet-preview-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.azpet-preview-body { padding: 16px 18px; overflow: auto; background: #F8FAFC; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.azpet-preview-img { max-width: 100%; max-height: 76vh; border-radius: 10px; border: 1px solid #E6EDF2; }
.azpet-preview-frame { width: 100%; height: 74vh; border: 1px solid #E6EDF2; border-radius: 10px; background: #fff; }
.azpet-preview-fallback { color: #7B8F9C; font-size: 12px; text-align: center; }
.azpet-preview-empty { padding: 40px 12px; font-size: 13px; }
[data-preview] { cursor: pointer; }
