:root {
    --primary: #6d35d4;
    --primary-dark: #4f22aa;
    --primary-light: #8c63e7;
    --primary-soft: #f1ebff;
    --ink: #1f2333;
    --muted: #73788c;
    --surface: #ffffff;
    --surface-alt: #f8f8fc;
    --canvas: #f3f4f8;
    --line: #e7e8ef;
    --success: #16865c;
    --danger: #c54255;
    --sidebar-width: 278px;
    --sidebar-collapsed-width: 88px;
    --shadow-sm: 0 1px 2px rgba(27, 22, 46, .04), 0 8px 24px rgba(42, 32, 73, .05);
    --shadow-md: 0 18px 50px rgba(42, 32, 73, .10);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: 'DM Sans', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.brand-copy strong,
.stat-value {
    font-family: 'Manrope', 'DM Sans', sans-serif;
    letter-spacing: -.035em;
}

a, button, input, select, textarea {
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.app-icon {
    display: block;
    width: 21px;
    height: 21px;
}

/* Autenticação */
.auth-bg {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 12%, rgba(124, 70, 226, .20), transparent 26%),
        radial-gradient(circle at 90% 88%, rgba(168, 128, 241, .18), transparent 28%),
        #f7f7fb;
}

.auth-wrapper {
    max-width: 1080px;
    border: 1px solid rgba(94, 53, 172, .10);
    box-shadow: var(--shadow-md) !important;
}

.auth-panel-left {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, #472095 0%, #6d35d4 58%, #8a5ae0 100%);
}

.auth-panel-left::before,
.auth-panel-left::after {
    position: absolute;
    content: '';
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
}

.auth-panel-left::before {
    width: 330px;
    height: 330px;
    right: -170px;
    top: -110px;
}

.auth-panel-left::after {
    width: 250px;
    height: 250px;
    left: -120px;
    bottom: -130px;
}

.auth-panel-right {
    background: rgba(255,255,255,.96);
}

/* Estrutura principal */
.dashboard-body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--canvas);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    flex: 0 0 var(--sidebar-width);
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 20px 16px 16px;
    color: #fff;
    background: #32186b;
    background-image:
        radial-gradient(circle at 20% 0, rgba(144, 95, 237, .33), transparent 34%),
        linear-gradient(180deg, #3b1c7c 0%, #291354 100%);
    box-shadow: 8px 0 35px rgba(37, 20, 75, .08);
    transition: width .24s ease, flex-basis .24s ease, transform .24s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 6px;
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 15px;
    background: rgba(255,255,255,.12);
    box-shadow: inset 0 1px rgba(255,255,255,.12);
}

.brand-mark .app-icon {
    width: 23px;
    height: 23px;
}

.brand-copy {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    white-space: nowrap;
}

.brand-copy strong {
    font-size: 1.06rem;
    font-weight: 800;
}

.brand-copy small {
    color: rgba(255,255,255,.55);
    font-size: .72rem;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    padding: 8px;
    color: #fff;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.08);
}

.sidebar-context {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 24px 6px 12px;
    padding: 10px 12px;
    color: rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.055);
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.context-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #68e1ad;
    box-shadow: 0 0 0 4px rgba(104,225,173,.12);
}

.sidebar-nav {
    display: flex;
    overflow-y: auto;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    padding: 8px 2px;
    scrollbar-width: thin;
}

.nav-section-label {
    margin: 0 12px 7px;
    color: rgba(255,255,255,.35);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.app-nav-link {
    position: relative;
    display: flex;
    min-height: 47px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: rgba(255,255,255,.68);
    border-radius: 12px;
    font-size: .91rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.app-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.075);
}

.app-nav-link.active {
    color: #fff;
    background: linear-gradient(110deg, rgba(149, 103, 235, .65), rgba(118, 66, 215, .36));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 7px 20px rgba(19,8,43,.16);
}

.app-nav-link.active::before {
    position: absolute;
    left: -2px;
    width: 3px;
    height: 22px;
    content: '';
    border-radius: 0 4px 4px 0;
    background: #c2a6ff;
}

.nav-icon {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    place-items: center;
}

.nav-arrow {
    margin-left: auto;
    opacity: 0;
}

.nav-arrow .app-icon {
    width: 15px;
    height: 15px;
}

.app-nav-link:hover .nav-arrow,
.app-nav-link.active .nav-arrow {
    opacity: .6;
}

.sidebar-footer {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 14px 9px 2px;
    border-top: 1px solid rgba(255,255,255,.09);
}

.user-avatar,
.topbar-avatar {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 12px;
    background: linear-gradient(145deg, #9568ed, #6b38ce);
    font-family: 'Manrope', sans-serif;
    font-size: .84rem;
    font-weight: 800;
}

.sidebar-user {
    display: flex;
    overflow: hidden;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.sidebar-user strong,
.sidebar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user strong {
    font-size: .82rem;
    font-weight: 700;
}

.sidebar-user span {
    color: rgba(255,255,255,.45);
    font-size: .69rem;
}

.logout-button {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    color: rgba(255,255,255,.55);
    border-radius: 10px;
}

.logout-button:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}

.logout-button .app-icon {
    width: 18px;
    height: 18px;
}

.app-main {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    min-height: 102px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(20px, 3vw, 42px);
    border-bottom: 1px solid rgba(224,225,234,.82);
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(18px);
}

.topbar-leading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
}

.menu-button {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #5c6071;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(32,29,45,.035);
}

.menu-button:hover {
    color: var(--primary);
    border-color: #d9cdf3;
    background: var(--primary-soft);
}

.page-heading {
    min-width: 0;
}

.page-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--primary);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.page-heading h1 {
    overflow: hidden;
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 800;
    line-height: 1.16;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: 13px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    color: #5d6272;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: .74rem;
    font-weight: 600;
}

.status-pill span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #26b57c;
    box-shadow: 0 0 0 4px rgba(38,181,124,.10);
}

.topbar-avatar {
    border: 0;
}

.page-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px clamp(20px, 3vw, 42px) 48px;
}

/* Componentes */
.panel-card,
.card-stat {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel-card {
    height: 100%;
    padding: clamp(18px, 2.2vw, 27px);
    border-radius: 18px;
}

.panel-card h2,
.panel-card h3 {
    font-size: 1.03rem;
    font-weight: 800;
}

.card-stat {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    padding: 21px;
    border-radius: 17px;
}

.card-stat::after {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 78px;
    height: 78px;
    content: '';
    border-radius: 50%;
    background: var(--primary-soft);
}

.stat-label {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
}

.stat-value {
    margin-top: 13px;
    font-size: 2rem;
    font-weight: 800;
}

.stat-meta {
    margin-top: 4px;
    color: #9599a8;
    font-size: .72rem;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.section-heading h2,
.section-heading h3 {
    margin: 0;
}

.section-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.alert {
    border-width: 1px;
    border-radius: 14px;
    font-size: .87rem;
}

.alert-success {
    color: #126d4c;
    border-color: #c9eedf;
    background: #eefbf6;
}

.alert-danger {
    color: #9e3445;
    border-color: #f0ccd2;
    background: #fff2f4;
}

.btn {
    min-height: 42px;
    border-radius: 11px;
    font-weight: 700;
}

.btn-primary {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 7px 16px rgba(109,53,212,.18);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: #d8caef;
}

.btn-outline-primary:hover {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.form-label {
    margin-bottom: 7px;
    color: #555a6c;
    font-size: .78rem;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 46px;
    padding: .7rem .85rem;
    color: var(--ink);
    border: 1px solid #dde0e8;
    border-radius: 11px;
    background-color: #fff;
    font-size: .88rem;
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.form-select:focus {
    border-color: #a98be3;
    box-shadow: 0 0 0 4px rgba(109,53,212,.10);
}

.form-control::placeholder {
    color: #b1b4c0;
}

/* Select2 alinhado aos campos do sistema */
.select2-container {
    max-width: 100%;
    font-size: .88rem;
}

.select2-container .select2-selection--single {
    height: 46px;
    border: 1px solid #dde0e8;
    border-radius: 11px;
    background: #fff;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 42px;
    padding-left: .85rem;
    color: var(--ink);
    line-height: 44px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #a4a8b5;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 10px;
    right: 9px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #a98be3;
    box-shadow: 0 0 0 4px rgba(109,53,212,.10);
}

.select2-dropdown {
    overflow: hidden;
    border: 1px solid #d9dce6;
    border-radius: 11px;
    box-shadow: var(--shadow-md);
}

.select2-search--dropdown {
    padding: 9px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    padding: 8px 10px;
    border: 1px solid #dde0e8;
    border-radius: 8px;
    outline: 0;
}

.select2-results__option {
    padding: 9px 12px;
    font-size: .84rem;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--primary);
}

.table-responsive {
    margin-right: -4px;
    margin-left: -4px;
}

.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #fafafe;
    --bs-table-hover-bg: #f7f4fd;
}

.table thead th {
    padding: .7rem .85rem;
    color: #8a8e9d;
    border-bottom-color: var(--line);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    padding: .95rem .85rem;
    color: #494e5e;
    border-bottom-color: #eff0f4;
    font-size: .84rem;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.badge-soft,
.role-badge {
    display: inline-flex;
    padding: .45rem .7rem;
    color: var(--primary-dark);
    border-radius: 999px;
    background: var(--primary-soft) !important;
    font-size: .7rem;
    font-weight: 800;
}

.empty-row td {
    padding: 2.5rem 1rem !important;
    color: var(--muted) !important;
    text-align: center;
}

.entity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: clamp(20px, 2.5vw, 28px);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.entity-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
}

.entity-avatar {
    display: grid;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    place-items: center;
    color: var(--primary);
    border-radius: 17px;
    background: var(--primary-soft);
}

.entity-avatar .app-icon {
    width: 28px;
    height: 28px;
}

.entity-identity h2 {
    overflow: hidden;
    margin: 0 0 4px;
    font-size: 1.18rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 16px;
    color: var(--muted);
    font-size: .79rem;
}

.pet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pet-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.pet-card-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

.pet-card-icon {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--primary);
    border-radius: 11px;
    background: var(--primary-soft);
}

.pet-card h3 {
    margin: 0;
    font-size: .94rem;
    font-weight: 800;
}

.pet-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0;
}

.pet-card-details span {
    padding: 5px 8px;
    color: #64697a;
    border-radius: 8px;
    background: #f5f5f9;
    font-size: .69rem;
    font-weight: 600;
}

.pet-card-stats {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: .72rem;
}

.pet-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.pet-card-actions .btn,
.btn-compact {
    min-height: 36px;
    padding: .45rem .7rem;
    font-size: .72rem;
}

.breed-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.breed-choice {
    position: relative;
    display: flex;
    overflow: hidden;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    padding: 7px;
    cursor: pointer;
    color: #5e6373;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    font-size: .68rem;
    font-weight: 700;
}

.breed-choice:hover {
    border-color: #cbb8ee;
    background: #fbf9ff;
}

.breed-choice input {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.breed-choice:has(input:checked) {
    color: var(--primary-dark);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109,53,212,.10);
}

.breed-choice-image {
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1.4;
    border-radius: 8px;
    background: var(--primary-soft);
}

.breed-choice-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.breed-gallery.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.breed-gallery.compact .breed-choice > span:last-child {
    display: none;
}

.breed-gallery.compact .breed-choice-image {
    aspect-ratio: 1;
}

.pet-photo-gallery {
    display: flex;
    overflow-x: auto;
    gap: 7px;
    margin: -3px -3px 14px;
    padding: 3px 3px 6px;
    scrollbar-width: thin;
}

.pet-photo-item {
    position: relative;
    flex: 0 0 76px;
    width: 76px;
}

.pet-photo-gallery a {
    display: block;
    width: 76px;
    height: 76px;
    border: 2px solid #fff;
    border-radius: 12px;
    box-shadow: 0 0 0 1px var(--line);
}

.pet-photo-item.primary a {
    box-shadow: 0 0 0 2px var(--primary);
}

.pet-photo-gallery img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.pet-photo-item form {
    position: absolute;
    right: 4px;
    bottom: 4px;
    margin: 0;
}

.pet-photo-item button {
    padding: 2px 5px;
    color: #fff;
    border: 0;
    border-radius: 5px;
    background: rgba(50,24,107,.86);
    font-size: .52rem;
    font-weight: 800;
}

.pet-photo-item button:disabled {
    opacity: 1;
    background: var(--success);
}

.pet-photo-add {
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
}

.pet-photo-add summary {
    cursor: pointer;
    color: var(--primary);
    font-size: .72rem;
    font-weight: 700;
}

.attachment-list {
    display: flex;
    max-width: 190px;
    flex-direction: column;
    gap: 5px;
}

.attachment-list a {
    overflow: hidden;
    padding: 5px 8px;
    color: var(--primary-dark);
    border-radius: 7px;
    background: var(--primary-soft);
    font-size: .68rem;
    font-weight: 700;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-list a:hover {
    background: #e7dcff;
}

.date-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.date-shortcuts button {
    padding: 2px 7px;
    color: var(--muted);
    border: 0;
    border-radius: 6px;
    background: #f0f1f6;
    font-size: .61rem;
    font-weight: 700;
}

.date-shortcuts button:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.sticky-form-card {
    position: sticky;
    top: 104px;
}

.view-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f5f5f9;
}

.view-toggle button {
    min-width: 58px;
    padding: 6px 10px;
    color: var(--muted);
    border: 0;
    border-radius: 7px;
    background: transparent;
    font-size: .68rem;
    font-weight: 800;
}

.view-toggle button.active {
    color: var(--primary-dark);
    background: #fff;
    box-shadow: 0 2px 8px rgba(39, 24, 70, .10);
}

.empty-state {
    padding: 48px 20px;
    color: var(--muted);
    text-align: center;
}

.vaccine-cards-view {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.vaccine-list-view {
    display: none;
}

.vaccine-collection[data-view="list"] .vaccine-cards-view {
    display: none;
}

.vaccine-collection[data-view="list"] .vaccine-list-view {
    display: block;
}

.vaccine-passport-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    border: 1px solid #ddd4ef;
    border-radius: 17px;
    background: linear-gradient(145deg, #fff 0%, #fcfaff 100%);
    box-shadow: 0 8px 24px rgba(59, 28, 124, .07);
}

.vaccine-passport-card::after {
    position: absolute;
    right: -40px;
    bottom: -52px;
    width: 120px;
    height: 120px;
    content: '';
    border: 18px solid rgba(109, 53, 212, .035);
    border-radius: 50%;
    pointer-events: none;
}

.vaccine-pet-profile {
    position: relative;
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 11px;
    padding: 15px;
    color: #fff;
    background: linear-gradient(120deg, #4b229e, #7541d6);
}

.vaccine-pet-photo {
    display: grid;
    overflow: hidden;
    width: 60px;
    height: 60px;
    place-items: center;
    border: 2px solid rgba(255,255,255,.65);
    border-radius: 15px;
    background: rgba(255,255,255,.14);
}

.vaccine-pet-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vaccine-pet-photo .app-icon {
    width: 28px;
    height: 28px;
}

.vaccine-pet-copy {
    min-width: 0;
    padding-right: 56px;
}

.vaccine-overline {
    display: block;
    margin-bottom: 2px;
    color: rgba(255,255,255,.62);
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.vaccine-pet-copy h3 {
    overflow: hidden;
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vaccine-pet-copy p,
.vaccine-pet-copy small {
    display: block;
    overflow: hidden;
    margin: 2px 0 0;
    color: rgba(255,255,255,.72);
    font-size: .62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.health-status {
    position: absolute;
    top: 13px;
    right: 12px;
    max-width: 68px;
    padding: 4px 6px;
    border-radius: 7px;
    background: rgba(255,255,255,.16);
    font-size: .52rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.health-status.success { color: #baf3d9; }
.health-status.warning { color: #ffe4a4; }
.health-status.danger { color: #ffc3cb; }
.health-status.neutral { color: rgba(255,255,255,.72); }

.vaccine-dose-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 15px 12px;
    border-bottom: 1px dashed var(--line);
}

.vaccine-dose-title strong,
.vaccine-dose-title span {
    display: block;
}

.vaccine-dose-title strong {
    color: var(--primary-dark);
    font-size: .93rem;
}

.vaccine-dose-title div > span {
    color: var(--muted);
    font-size: .62rem;
}

.vaccine-dose-title .dose-date {
    flex: 0 0 auto;
    padding: 5px 7px;
    color: var(--primary-dark);
    border-radius: 7px;
    background: var(--primary-soft);
    font-size: .62rem;
    font-weight: 800;
}

.vaccine-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin: 0;
    padding: 14px 15px;
}

.vaccine-data-grid div {
    min-width: 0;
}

.vaccine-data-grid dt {
    margin-bottom: 2px;
    color: #979aaa;
    font-size: .54rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.vaccine-data-grid dd {
    overflow: hidden;
    margin: 0;
    color: #4e5365;
    font-size: .66rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vaccine-card-note {
    position: relative;
    z-index: 1;
    margin: 0 15px 15px;
    padding: 8px 10px;
    color: #666b7b;
    border-left: 3px solid #bda5e9;
    border-radius: 0 8px 8px 0;
    background: #f7f3ff;
    font-size: .63rem;
}

.internal-field {
    padding: 12px;
    border: 1px solid #e8cf84;
    border-radius: 12px;
    background: #fffaf0;
}

.internal-field label {
    color: #805f09;
}

.internal-field small {
    display: block;
    margin-top: 6px;
    color: #9c7c28;
    font-size: .62rem;
}

.private-badge {
    display: inline-flex;
    margin-left: 5px;
    padding: 3px 6px;
    color: #7d5c05;
    border-radius: 6px;
    background: #f8e8af;
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.medical-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.medical-record-card {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.medical-record-card:target {
    border-color: #bda7e9;
    box-shadow: 0 0 0 4px rgba(109,53,212,.08);
}

.medical-record-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
}

.medical-record-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.medical-record-meta time {
    color: var(--muted);
    font-size: .65rem;
    font-weight: 700;
}

.medical-record-header h3 {
    margin: 0;
    font-size: 1rem;
}

.medical-record-header h3 small {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
}

.medical-record-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .66rem;
}

.record-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.record-actions form {
    margin: 0;
}

.record-summary {
    margin-top: 13px;
    padding: 12px;
    border-radius: 10px;
    background: #f7f5fc;
}

.record-summary strong,
.record-detail-grid strong,
.record-attachments > strong {
    display: block;
    margin-bottom: 4px;
    color: #555b6d;
    font-size: .63rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.record-summary p,
.record-detail-grid p,
.internal-note p {
    margin: 0;
    color: #555b69;
    font-size: .75rem;
    line-height: 1.55;
}

.clinical-vitals {
    display: flex;
    gap: 8px;
    margin-top: 11px;
}

.clinical-vitals span {
    padding: 7px 10px;
    color: var(--muted);
    border-radius: 8px;
    background: var(--primary-soft);
    font-size: .65rem;
}

.clinical-vitals strong {
    color: var(--primary-dark);
}

.record-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin-top: 14px;
}

.record-detail-grid > div {
    min-width: 0;
}

.internal-note {
    margin-top: 14px;
    padding: 11px 12px;
    color: #755806;
    border: 1px solid #ead38f;
    border-radius: 10px;
    background: #fff9e9;
}

.internal-note > div {
    margin-bottom: 5px;
}

.internal-note p {
    color: #765f20;
}

.record-attachments {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.attachment-list.horizontal {
    max-width: none;
    flex-direction: row;
    flex-wrap: wrap;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 3vw, 38px);
    color: #fff;
    border-radius: 22px;
    background: linear-gradient(125deg, #4a219e 0%, #713dd1 58%, #8c62dd 100%);
    box-shadow: 0 20px 40px rgba(79,34,170,.18);
}

.dashboard-hero::after {
    position: absolute;
    right: -85px;
    bottom: -145px;
    width: 300px;
    height: 300px;
    content: '';
    border: 45px solid rgba(255,255,255,.07);
    border-radius: 50%;
}

.dashboard-hero > * {
    position: relative;
    z-index: 1;
}

.dashboard-hero h2 {
    max-width: 650px;
    margin: 0 0 10px;
    font-size: clamp(1.45rem, 3vw, 2.35rem);
    font-weight: 800;
}

.dashboard-hero p {
    max-width: 620px;
    margin: 0;
    color: rgba(255,255,255,.70);
    font-size: .92rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    text-decoration: none;
}

.quick-link:hover {
    color: var(--primary-dark);
    border-color: #d9cdf0;
    background: #fbf9ff;
    transform: translateY(-1px);
}

.quick-link-icon {
    display: grid;
    flex: 0 0 39px;
    width: 39px;
    height: 39px;
    place-items: center;
    color: var(--primary);
    border-radius: 11px;
    background: var(--primary-soft);
}

.quick-link strong {
    display: block;
    font-size: .84rem;
}

.quick-link small {
    color: var(--muted);
    font-size: .7rem;
}

.sidebar-overlay {
    display: none;
}

/* Sidebar recolhida no desktop */
body.sidebar-collapsed .sidebar {
    flex-basis: var(--sidebar-collapsed-width);
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar .brand-copy,
body.sidebar-collapsed .sidebar .sidebar-context .nav-label,
body.sidebar-collapsed .sidebar .nav-section-label,
body.sidebar-collapsed .sidebar .app-nav-link .nav-label,
body.sidebar-collapsed .sidebar .nav-arrow,
body.sidebar-collapsed .sidebar .sidebar-user {
    display: none;
}

body.sidebar-collapsed .sidebar-context {
    justify-content: center;
    padding-inline: 8px;
}

body.sidebar-collapsed .app-nav-link {
    justify-content: center;
    padding-inline: 8px;
}

body.sidebar-collapsed .sidebar-footer {
    flex-direction: column;
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
    }

    .app-main {
        width: 100%;
        max-width: 100%;
    }

    .sidebar {
        position: fixed;
        left: 0;
        width: min(86vw, 292px);
        max-width: 292px;
        transform: translateX(-105%);
        box-shadow: 18px 0 55px rgba(26,12,55,.30);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        display: grid;
        place-items: center;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        visibility: hidden;
        padding: 0;
        opacity: 0;
        border: 0;
        background: rgba(23,13,45,.50);
        backdrop-filter: blur(2px);
        transition: opacity .2s ease, visibility .2s ease;
    }

    .sticky-form-card {
        position: static;
    }

    .vaccine-cards-view {
        grid-template-columns: 1fr;
    }

    body.sidebar-open .sidebar-overlay {
        visibility: visible;
        opacity: 1;
    }

    .topbar {
        min-height: 86px;
    }

    body.sidebar-collapsed .sidebar {
        width: min(86vw, 292px);
    }

    body.sidebar-collapsed .sidebar .brand-copy,
    body.sidebar-collapsed .sidebar .sidebar-context .nav-label,
    body.sidebar-collapsed .sidebar .nav-section-label,
    body.sidebar-collapsed .sidebar .app-nav-link .nav-label,
    body.sidebar-collapsed .sidebar .nav-arrow,
    body.sidebar-collapsed .sidebar .sidebar-user {
        display: initial;
    }

    body.sidebar-collapsed .app-nav-link {
        justify-content: flex-start;
        padding-inline: 12px;
    }

    body.sidebar-collapsed .sidebar-footer {
        flex-direction: row;
    }
}

@media (max-width: 575.98px) {
    .topbar {
        min-height: 76px;
        padding: 13px 15px;
    }

    .topbar-leading {
        gap: 11px;
    }

    .menu-button {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .page-eyebrow,
    .page-heading p,
    .status-pill,
    .topbar-avatar {
        display: none;
    }

    .page-heading h1 {
        max-width: calc(100vw - 92px);
        font-size: 1.2rem;
    }

    .page-content {
        padding: 18px 14px 34px;
    }

    .panel-card {
        padding: 17px;
        border-radius: 15px;
    }

    .card-stat {
        min-height: 122px;
        padding: 17px;
    }

    .stat-value {
        font-size: 1.7rem;
    }

    .btn:not(.menu-button, .sidebar-close, .btn-compact) {
        width: 100%;
    }

    .entity-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .entity-header > .btn {
        width: 100%;
    }

    .pet-grid {
        grid-template-columns: 1fr;
    }

    .pet-card-actions {
        flex-direction: column;
    }

    .vaccine-heading,
    .medical-record-header {
        align-items: stretch;
        flex-direction: column;
    }

    .view-toggle {
        width: 100%;
    }

    .view-toggle button {
        flex: 1;
    }

    .record-actions {
        width: 100%;
    }

    .record-actions > *,
    .record-actions .btn {
        flex: 1;
        width: 100%;
    }

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

    .table-responsive {
        width: calc(100% + 8px);
    }

    .dashboard-hero {
        padding: 24px 20px;
        border-radius: 17px;
    }

    .auth-panel-left,
    .auth-panel-right {
        padding: 1.5rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
