/* assets/css/style.css */
/* PetJoy - Main Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ============================================================
   PWA — FULLSCREEN & SAFE AREA
   ============================================================ */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
}

/* Cobre toda a tela incluindo notch e home indicator do iOS */
body {
    padding-top: var(--sat);
    padding-right: var(--sar);
    padding-left: var(--sal);
}

/* Bottom nav sobe acima do home indicator do iOS */
.mobile-nav {
    padding-bottom: calc(8px + var(--sab));
    height: calc(var(--nav-height-mobile) + var(--sab));
}

/* Mobile header desce abaixo do notch */
.mobile-header {
    padding-top: calc(16px + var(--sat));
}

/* Garante que o conteúdo não fique embaixo do bottom nav + home indicator */
@media (max-width: 900px) {
    .main-content {
        padding-bottom: calc(var(--nav-height-mobile) + var(--sab));
    }
}

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --primary: #5b4acf;
    --primary-hover: #4a3ab5;
    --primary-light: #ede9ff;
    --primary-soft: #f5f3ff;

    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    --bg: #f8f7ff;
    --bg-white: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --border: #e5e7eb;
    --border-light: #f3f4f6;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px rgba(91, 74, 207, 0.12);
    --shadow-lg: 0 20px 40px rgba(91, 74, 207, 0.15);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --nav-height-mobile: 70px;
    --sidebar-width: 260px;
    --transition: all 0.2s ease;

    /* Activity type colors */
    --vaccine-color: #5b4acf;
    --vaccine-bg: #ede9ff;
    --medication-color: #059669;
    --medication-bg: #d1fae5;
    --exam-color: #d97706;
    --exam-bg: #fef3c7;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

ul,
ol {
    list-style: none;
}

/* ============================================================
   AUTH LAYOUT (Login / Register)
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(145deg, #f5f3ff 0%, #ede9ff 50%, #ffffff 100%);
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    width: 80px;
    height: 80px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-align: center;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================================
   APP LAYOUT (Authenticated)
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar hidden when body has is-mobile class (set by JS before render) */
body.is-mobile .sidebar {
    display: none !important;
    width: 0 !important;
}

body.is-mobile .main-content {
    margin-left: 0 !important;
}

/* Sidebar (Desktop) */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo img {
    width: 38px;
    height: 38px;
}

.sidebar-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-logo-text span {
    color: var(--text-secondary);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 8px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-item i {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.nav-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-plan {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Main Content */
.main-content {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-header-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.page-body {
    padding: 28px;
    flex: 1;
}

/* Mobile Bottom Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height-mobile);
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0 8px;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-width: 56px;
}

.mobile-nav-item i {
    font-size: 22px;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item.active i {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 4px;
    margin: -4px;
}

.mobile-nav-badge {
    position: absolute;
    top: 4px;
    right: 14px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Mobile header (replaces page-header on mobile) */
.mobile-header {
    display: none;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 50;
}

.mobile-header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-header-logo img {
    width: 30px;
}

.mobile-header-logo-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}

.mobile-header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 74, 207, 0.12);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--border-light);
    cursor: not-allowed;
    color: var(--text-muted);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
}

.input-group .form-control {
    padding-left: 40px;
}

.input-icon-right {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.input-group .has-icon-right {
    padding-right: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    line-height: 1;
    -webkit-appearance: none;
}

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

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

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--primary-light);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-danger:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius);
}

.btn i {
    font-size: 18px;
}

.btn-sm i {
    font-size: 15px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg);
}

/* ============================================================
   DASHBOARD — layout full-width fundo branco
   ============================================================ */
.page-body-dashboard {
    padding: 0 !important;
    /*background: #fff;*/
}

/* Saúde — igual ao dashboard mas com padding-top mobile para o header fixo */
.page-body-saude {
    padding: 0 !important;
}

.page-body-saude .alert {
    margin: 12px 16px 0;
}

.page-body-saude .card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

.page-body-saude .empty-state {
    padding: 32px 16px;
}

.page-body-saude .clean-list {
    border-radius: 0;
    border-top: 1px solid var(--border-light);
}

.page-body-dashboard .alert {
    margin: 12px 16px 0;
}

.page-body-dashboard .card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

.page-body-dashboard .empty-state {
    padding: 32px 16px;
}

.dash-section-header {
    padding: 16px 16px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.clean-list {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* No dashboard, clean-list ocupa full-width sem radius */
.page-body-dashboard .clean-list {
    border-radius: 0;
    border-top: 1px solid var(--border-light);
}

/* ============================================================
   ACTIVITY CARDS (Dashboard)
   ============================================================ */
.act-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 14px;
}

.act-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.act-card-info {
    flex: 1;
    min-width: 0;
}

.act-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.act-card-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.act-card-date {
    font-size: 13px;
    color: var(--text-secondary);

    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.act-card-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 70px;
}

/* Checkbox vazio (pendente) */
.act-checkbox {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.act-checkbox:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* Checkbox marcado (concluído) */
.act-checkbox-done {
    background: var(--primary);
    border-color: var(--primary);
}

.act-checkbox-done:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Badges de status */
.act-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.act-badge-today {
    background: var(--success-light);
    color: var(--success);
}

.act-badge-late {
    background: var(--danger-light);
    color: var(--danger);
}

.act-badge-done {
    background: var(--border-light);
    color: var(--text-muted);
}

/* ============================================================
   CLEAN LIST (Dashboard)
   ============================================================ */
.clean-list {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.clean-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
    transition: background 0.15s;
}

.clean-item:last-child {
    border-bottom: none;
}

.clean-item:active {
    background: var(--bg);
}

.clean-item-overdue {}

.clean-item-overdue:last-child {
    border-bottom: none;
}

.clean-item-done {}

.clean-item-info {
    flex: 1;
    min-width: 0;
}

.clean-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.clean-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.clean-item-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.clean-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.clean-action-btn:hover {
    background: var(--border-light);
}

/* ============================================================
   ACTIVITY ITEMS
   ============================================================ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.activity-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.activity-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.type-vaccine .activity-icon {
    background: var(--vaccine-bg);
    color: var(--vaccine-color);
}

.type-medication .activity-icon {
    background: var(--medication-bg);
    color: var(--medication-color);
}

.type-exam .activity-icon {
    background: var(--exam-bg);
    color: var(--exam-color);
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.activity-meta i {
    font-size: 13px;
}

.activity-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.activity-done {
    opacity: 0.6;
}

.activity-done .activity-title {
    text-decoration: line-through;
}

.activity-overdue {
    border-color: var(--danger) !important;
    background: #fff8f8;
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-done {
    background: var(--success-light);
    color: var(--success);
}

.badge-cancelled {
    background: var(--border-light);
    color: var(--text-muted);
}

.badge-vaccine {
    background: var(--vaccine-bg);
    color: var(--vaccine-color);
}

.badge-medication {
    background: var(--medication-bg);
    color: var(--medication-color);
}

.badge-exam {
    background: var(--exam-bg);
    color: var(--exam-color);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================================
   STATS / SUMMARY CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.stat-number {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success {
    background: var(--success-light);
    color: #15803d;
    border-color: #86efac;
}

.alert-danger {
    background: var(--danger-light);
    color: #b91c1c;
    border-color: #fca5a5;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-color: #fcd34d;
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border-color: #93c5fd;
}

/* ============================================================
   PET CARDS
   ============================================================ */
.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.pet-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.pet-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pet-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.pet-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 30px;
    color: var(--primary);
    overflow: hidden;
}

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

.pet-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.pet-breed {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
    display: block;
}

.empty-state-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 13px;
    margin-bottom: 16px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-drag {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin: 12px auto 8px;
    flex-shrink: 0;
}

.modal-header {
    padding: 8px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Footer always at bottom, outside scroll area */
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: var(--bg-white);
}

/* ============================================================
   TABS (Month navigation)
   ============================================================ */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    /*border-radius: var(--radius-lg);*/
    padding: 12px 16px;
    margin-bottom: 5px;
}

.month-nav-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.month-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    transition: var(--transition);
    text-decoration: none;
}

.month-nav-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================================
   NOTIFICATION ITEMS
   ============================================================ */
.notification-list {
    display: flex;
    flex-direction: column;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--bg);
}

.notification-item.unread {
    background: var(--primary-soft);
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}

.notification-dot.read {
    background: transparent;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.notification-info {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.5;
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-section {
    margin-bottom: 24px;
}

.settings-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding-left: 4px;
}

.settings-list {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: var(--bg);
}

.settings-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.settings-item-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.settings-item-info {
    flex: 1;
}

.settings-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-item-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.settings-item-arrow {
    font-size: 18px;
    color: var(--text-muted);
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: 20px 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin: 20px 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

.dialog-overlay.open {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.dialog-box {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    padding: 28px 28px 24px;
    width: 100%;
    max-width: 360px;
    animation: dialogPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

@keyframes dialogPop {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.dialog-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.dialog-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dialog-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.dialog-actions .btn {
    flex: 1;
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

/* ============================================================
   DATE PICKER — native input, no customization needed
   ============================================================ */
.date-picker-icon {
    display: none;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary);
    font-size: 18px;
}

/* ============================================================
   RESPONSIVE — MOBILE FIRST
   ============================================================ */
@media (max-width: 900px) {

    /* Hide sidebar on small screens */
    .sidebar {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        flex-shrink: 1 !important;
        overflow: hidden !important;
    }

    /* No sidebar space on mobile */
    .main-content {
        padding-bottom: var(--nav-height-mobile);
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Show mobile bottom nav */
    .mobile-nav {
        display: flex;
    }

    /* Show mobile header, hide desktop header */
    .mobile-header {
        display: flex;
    }

    .page-header {
        display: none;
    }

    /* Adjust page body padding */
    .page-body {
        padding: 16px;
        padding-top: 80px;
    }

    .page-body-dashboard {
        padding: 0;
    }

    .page-body-saude {
        padding-top: 65px !important;
    }

    /* Stats grid 3 cols on mobile */
    .stats-grid {
        gap: 10px;
    }

    .stat-number {
        font-size: 22px;
    }

    /* Full width form rows on mobile */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Pets grid */
    .pets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    @media (max-width: 900px) {
        .modal-overlay {
            align-items: flex-end;
            padding: 0;
            padding-top: 60px;
        }

        .modal {
            border-radius: var(--radius-xl) var(--radius-xl) 0 0;
            max-height: calc(95vh - 60px);
        }
    }
}

@media (min-width: 901px) {

    /* Hide mobile elements on desktop */
    .mobile-nav {
        display: none !important;
    }

    .mobile-header {
        display: none !important;
    }

    .page-header {
        display: flex;
    }

    /* Modal as centered dialog on desktop */
    .modal-overlay {
        align-items: center;
        padding: 20px;
    }

    .modal {
        border-radius: var(--radius-xl);
        max-height: 85vh;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary-color {
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.mt-0 {
    margin-top: 0;
}

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

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

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

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

.mb-8 {
    margin-bottom: 8px;
}

.mb-12 {
    margin-bottom: 12px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-20 {
    margin-bottom: 20px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.w-100 {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ============================================================
   PET HISTORY POPUP
   ============================================================ */

.history-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    padding-top: 60px;
}

.history-popup-overlay.open {
    display: flex;
}

.history-popup {
    background: #fff;
    width: 100%;
    max-width: 560px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    height: calc(95vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.history-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.history-popup-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.history-popup-title i {
    font-size: 20px;
    color: var(--primary);
}

.history-popup-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.history-share-btn i {
    font-size: 16px;
}

.history-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.history-close-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.history-popup-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.history-popup-body iframe {
    width: 100%;
    flex: 1;
    border: none;
    min-height: 0;
}

@media (min-width: 901px) {
    .history-popup-overlay {
        align-items: center;
        padding: 20px;
    }

    .history-popup {
        border-radius: var(--radius-xl);
        height: 85vh;
    }
}

/* ============================================================
   PET HISTORY TIMELINE
   ============================================================ */

/* Botão de histórico no card do pet */
.pet-history-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 20px;
    transition: var(--transition);
    flex-shrink: 0;
}

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

/* Botão voltar no header */
.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 20px;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-back:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Container da timeline */
.pet-timeline {
    padding: 20px 20px 32px;
}

/* Label do mês */
.timeline-month-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 24px 0 12px 52px;
}

.timeline-month-label:first-child {
    margin-top: 0;
}

/* Item da timeline */
.timeline-item {
    display: flex;
    gap: 0;
    position: relative;
}

/* Coluna esquerda: dot + linha */
.timeline-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 44px;
    flex-shrink: 0;
}

.timeline-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    z-index: 1;
}

/* Cores por tipo de atividade */
.timeline-dot-vaccine {
    background: var(--vaccine-bg);
    color: var(--vaccine-color);
}
.timeline-dot-medication {
    background: var(--medication-bg);
    color: var(--medication-color);
}
.timeline-dot-exam {
    background: var(--exam-bg);
    color: var(--exam-color);
}
.timeline-dot-bath {
    background: var(--primary-light);
    color: var(--primary);
}
.timeline-dot-appointment {
    background: var(--info-light);
    color: var(--info);
}
.timeline-dot-other,
.timeline-dot- {
    background: var(--border-light);
    color: var(--text-muted);
}

/* Linha vertical conectando os itens */
.timeline-line {
    width: 2px;
    flex: 1;
    min-height: 20px;
    background: var(--border);
    margin: 4px 0;
}

/* Conteúdo à direita do dot */
.timeline-content {
    flex: 1;
    padding: 6px 0 20px 12px;
}

.timeline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.timeline-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.timeline-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.timeline-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.timeline-type-badge-vaccine    { background: var(--vaccine-bg);    color: var(--vaccine-color); }
.timeline-type-badge-medication { background: var(--medication-bg); color: var(--medication-color); }
.timeline-type-badge-exam       { background: var(--exam-bg);       color: var(--exam-color); }
.timeline-type-badge-bath       { background: var(--primary-light); color: var(--primary); }
.timeline-type-badge-appointment{ background: var(--info-light);    color: var(--info); }
.timeline-type-badge-other,
.timeline-type-badge-           { background: var(--border-light);  color: var(--text-muted); }

.timeline-notes {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Marcador de fim da timeline */
.timeline-end {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-left: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.timeline-end i {
    font-size: 22px;
    color: var(--border);
    width: 36px;
    text-align: center;
}