/* CatBox v6 - Complete Redesign */
:root {
    /* Couleurs */
    --primary: #2D7A6D;
    --primary-light: #3D9B8A;
    --primary-soft: #E8F5F2;
    --primary-glow: rgba(45, 122, 109, 0.1);
    --bg: #FAFBFC;
    --surface: #FFFFFF;
    --surface-hover: #F8F9FA;
    --border: #E2E8F0;
    --border-light: #EDF2F7;
    --text-primary: #1A202C;
    --text-secondary: #64748B;
    --text-muted: #A0AEC0;
    --success: #38A169;
    --success-soft: #E6F6EC;
    --warning: #DD6B20;
    --warning-soft: #FEEBC8;
    --danger: #E53E3E;
    --danger-soft: #FED7D7;
    --info: #3182CE;
    --info-soft: #E1EFFE;
    --premium: #805AD5;
    --premium-soft: #E9D8FD;
    --veilleur: #f59e0b;
    --veilleur-soft: #fef3c7;

    /* Ombres */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-btn: 0 2px 6px rgba(45, 122, 109, 0.2);

    /* Dimensions */
    --header-h: 56px;
    --nav-h: 72px;
    --sidebar-w: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* RESPONSIVE: Safe-areas iOS/Android */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* RESPONSIVE: Viewport height dynamique (mis à jour par JS) */
    --vh: 1vh;

    /* ACCESSIBILITE: Système z-index cohérent */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-loading: 600;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 430px;
    margin: 0 auto;
    min-height: calc(var(--vh, 1vh) * 100);
    min-height: 100dvh;
    background: var(--bg);
    position: relative;
}

/* Message "Utilisez votre téléphone" sur desktop */
.desktop-warning {
    display: none;
}

@media (min-width: 768px) {
    .app {
        display: none !important;
    }

    .desktop-warning {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 40px;
        text-align: center;
        background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    }

    .desktop-warning-icon {
        font-size: 80px;
        margin-bottom: 24px;
    }

    .desktop-warning h1 {
        font-size: 28px;
        font-weight: 700;
        color: var(--primary);
        margin-bottom: 16px;
    }

    .desktop-warning p {
        font-size: 16px;
        color: var(--text-secondary);
        max-width: 400px;
        line-height: 1.6;
    }

    .desktop-warning-qr {
        margin-top: 32px;
        padding: 20px;
        background: white;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .desktop-warning-url {
        margin-top: 16px;
        font-size: 14px;
        color: var(--primary);
        font-weight: 600;
    }
}

/* SUPPRIME - ancien tablet */
/*
@media (min-width: 768px) and (max-width: 1023px) {
    .app {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* HEADER - Background étendu jusqu'au notch */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(var(--header-h) + var(--safe-top));
    padding-top: var(--safe-top);
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: var(--z-sticky);
}

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

.header-logo svg {
    width: 28px;
    height: 28px;
}

.header-logo span {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
}

.header-cat-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-soft);
    border-radius: 20px;
    cursor: pointer;
}

.header-cat-selector img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.header-cat-selector span {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 4px;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    position: relative;
}

.header-btn:hover {
    background: var(--surface-hover);
}

.header-btn i {
    font-size: 22px;
}

.header-btn .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

/* MAIN - Hauteur dynamique pour iOS/Android */
.main {
    padding-top: calc(var(--header-h) + var(--safe-top));
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    min-height: calc(var(--vh, 1vh) * 100);
    min-height: 100dvh;
}

.screen {
    display: none;
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.card-action {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

/* CAT HERO */
.cat-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 20px;
    color: white;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.cat-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.cat-hero-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.cat-hero-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.cat-hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
    transition: transform 0.2s;
}

.cat-hero-avatar-wrapper:hover .cat-hero-avatar {
    transform: scale(1.05);
}

.cat-hero-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 12px;
    box-shadow: var(--shadow-md);
}

.cat-hero-info {
    flex: 1;
}

.cat-hero-info h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 2px;
}

.cat-hero-info p {
    font-size: 13px;
    opacity: 0.9;
}

.cat-hero-edit {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-hero-edit:hover {
    background: rgba(255,255,255,0.3);
}

.cat-hero-edit i {
    font-size: 18px;
}

.cat-hero-stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

.cat-hero-stat {
    flex: 1;
    text-align: center;
}

.cat-hero-stat-value {
    font-size: 18px;
    font-weight: 700;
}

.cat-hero-stat-label {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 2px;
}

/* QUICK ACTIONS */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-xs);
}

.quick-action:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.quick-action i {
    font-size: 24px;
    color: var(--primary);
}

.quick-action.premium i {
    color: var(--premium);
}

.quick-action span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* ALERTS */
.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.alert-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.alert-icon.success {
    background: var(--success-soft);
    color: var(--success);
}

.alert-icon.info {
    background: var(--info-soft);
    color: var(--info);
}

.alert-icon i {
    font-size: 18px;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-title {
    font-weight: 600;
    font-size: 13px;
}

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

.alert-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* WEIGHT CHART */
.weight-chart {
    height: 80px;
    background: linear-gradient(180deg, var(--primary-soft) 0%, transparent 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 12px;
    margin-top: 8px;
}

.weight-bar {
    width: 8%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
}

/* HEALTH TABS */
.health-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.health-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.health-tab:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.health-tab.active {
    background: var(--primary);
    color: white;
    padding: 10px 16px;
}

.health-tab i {
    font-size: 18px;
}

.health-tab span {
    display: none;
}

.health-tab.active span {
    display: inline;
}

.health-content {
    display: none;
}

.health-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-title {
    font-weight: 600;
    font-size: 15px;
}

.section-add-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--primary);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    font-family: inherit;
}

.section-add-btn i {
    font-size: 14px;
}

/* LIST ITEMS */
.list-item {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.list-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-item-status {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-item-status i {
    font-size: 18px;
}

.list-item-status.ok {
    background: var(--success-soft);
    color: var(--success);
}

.list-item-status.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    font-size: 14px;
}

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

.list-item-meta {
    text-align: right;
    flex-shrink: 0;
}

.list-item-meta-label {
    font-size: 10px;
    color: var(--text-muted);
}

.list-item-meta-value {
    font-size: 13px;
    font-weight: 600;
}

.list-item-meta-value.warning {
    color: var(--warning);
}

.list-item-meta-value.ok {
    color: var(--success);
}

.list-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 8px;
}

.list-item-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.list-item-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.list-item-action.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.list-item-action i {
    font-size: 14px;
}

/* RENEW BAR */
.list-item-renew {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.renew-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.renew-btn.primary {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
}

.renew-btn.primary:hover {
    background: var(--primary);
    color: white;
}

.renew-btn.secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}

.renew-btn.secondary:hover {
    border-color: var(--text-secondary);
}

.renew-btn i {
    font-size: 14px;
}

/* TREATMENT CARDS */
.treatment-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.treatment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.treatment-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.treatment-name {
    font-weight: 600;
    font-size: 14px;
}

.treatment-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.treatment-badge.active {
    background: var(--success-soft);
    color: var(--success);
}

.treatment-badge.completed {
    background: var(--surface-hover);
    color: var(--text-muted);
}

.treatment-details {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.treatment-detail {
    display: flex;
    align-items: center;
    gap: 4px;
}

.treatment-detail i {
    font-size: 14px;
    color: var(--primary);
}

.treatment-progress {
    margin-top: 10px;
    padding: 0 14px 12px;
}

.treatment-progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.treatment-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.treatment-progress-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
}

/* VISIT CARDS */
/* Year separator for grouped lists */
.year-separator {
    display: flex;
    align-items: center;
    margin: 16px 0 12px;
    padding: 0 4px;
}

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

.year-separator span {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--primary-soft);
    border-radius: 12px;
    margin: 0 12px;
}

.visit-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.visit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--primary-soft);
}

.visit-date-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.visit-date-badge i {
    font-size: 14px;
}

.visit-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.visit-cost {
    font-weight: 700;
    font-size: 14px;
}

.visit-body {
    padding: 14px;
}

.visit-reason {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.visit-vet {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.visit-vet i {
    font-size: 14px;
}

.visit-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* NOTE CARDS */
.note-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--info);
}

.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.1) 0%, rgba(49, 130, 206, 0.03) 100%);
    border-bottom: 1px solid var(--border-light);
}

.note-date {
    font-size: 12px;
    color: var(--info);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-date i {
    font-size: 14px;
}

/* AI Notes have purple color */
.note-card:has(.note-source) {
    border-left-color: var(--premium);
}

.note-card:has(.note-source) .note-header {
    background: linear-gradient(135deg, rgba(128, 90, 213, 0.1) 0%, rgba(128, 90, 213, 0.03) 100%);
}

.note-card:has(.note-source) .note-date {
    color: var(--premium);
}

.note-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-source {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--premium-soft);
    border-radius: 4px;
    font-size: 10px;
    color: var(--premium);
    font-weight: 600;
}

.note-source i {
    font-size: 12px;
}

.note-body {
    padding: 14px;
}

.note-text {
    font-size: 14px;
    line-height: 1.6;
}

/* DOC CARDS */
.doc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.doc-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-icon.pdf {
    background: var(--danger-soft);
    color: var(--danger);
}

.doc-icon.img {
    background: var(--info-soft);
    color: var(--info);
}

.doc-icon i {
    font-size: 20px;
}

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

.doc-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* CHAT */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h) - var(--nav-h) - 32px);
}

.chat-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.chat-cat-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.chat-cat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.chat-cat-avatar-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    border: 2px solid var(--surface);
}

.chat-cat-info {
    flex: 1;
}

.chat-cat-info h4 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-cat-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 9px;
    font-weight: 600;
    border-radius: 4px;
}

.chat-cat-badge i {
    font-size: 10px;
}

.chat-cat-actions {
    display: flex;
    gap: 4px;
}

.chat-cat-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-cat-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chat-cat-btn.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.chat-cat-btn i {
    font-size: 16px;
}

/* CHAT INTRO */
.chat-intro {
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
}

.chat-intro-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.chat-intro-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.chat-intro-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

.chat-intro-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-intro-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-intro-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.4;
    box-shadow: var(--shadow-xs);
}

.chat-intro-feature i {
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.chat-intro-feature strong {
    color: var(--primary);
}

/* CHAT MESSAGES */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-avatar.bot {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.bot .chat-bubble {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-top-left-radius: 4px;
}

.chat-message.user .chat-bubble {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

.chat-confirm {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.chat-confirm-title {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.chat-confirm-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.chat-confirm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface-hover);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.chat-confirm-item i {
    font-size: 14px;
    color: var(--primary);
}

.chat-confirm-btns {
    display: flex;
    gap: 8px;
}

.chat-confirm-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.chat-confirm-btn.confirm {
    background: var(--primary);
    color: white;
}

.chat-confirm-btn.cancel {
    background: var(--surface-hover);
    color: var(--text-secondary);
}

.chat-typing {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.chat-typing.active {
    display: flex;
}

.chat-typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.chat-input-container {
    padding: 12px 0;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-attach {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-attach:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chat-attach i {
    font-size: 20px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-btn);
    flex-shrink: 0;
}

.chat-send i {
    font-size: 20px;
}

/* Chat Mic Button */
.chat-mic {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-mic:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chat-mic i {
    font-size: 20px;
}

.chat-mic.listening {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    animation: pulse-mic 1s infinite;
}

@keyframes pulse-mic {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Weight History */
.weight-history-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

.weight-history-toggle:hover {
    color: var(--primary);
}

.weight-history-toggle i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.weight-history-toggle i.rotated {
    transform: rotate(180deg);
}

.weight-history {
    padding: 0 16px 16px;
}

.weight-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.weight-history-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.weight-history-value {
    font-weight: 600;
    color: var(--text-primary);
}

.weight-history-date {
    font-size: 12px;
    color: var(--text-muted);
}

.weight-history-delete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weight-history-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

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

.empty-state-small i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.empty-state-small p {
    font-size: 13px;
    margin: 0;
}

/* BOTTOM NAV - Background étendu sous l'indicateur home iOS */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(var(--nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    padding-left: max(24px, var(--safe-left));
    padding-right: max(24px, var(--safe-right));
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-sticky);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}

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

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

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-item.center {
    position: relative;
    margin-top: -28px;
}

.nav-center-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: 4px solid var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-btn);
}

.nav-center-btn i {
    font-size: 28px;
}

.nav-item.center span {
    margin-top: 4px;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: var(--z-modal-backdrop);
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    width: 100%;
    max-width: 430px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px;
    animation: slideUp 0.3s ease;
}

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

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

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

.form-group {
    margin-bottom: 16px;
}

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

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: var(--surface);
    color: var(--text-primary);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Select styling pour enlever les styles par defaut */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

select.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Input file styling */
input[type="file"].form-input {
    padding: 10px 14px;
    cursor: pointer;
}

input[type="file"].form-input::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="file"].form-input::file-selector-button:hover {
    background: var(--primary-light);
}

/* Input date styling - Enhanced for mobile */
input[type="date"].form-input {
    cursor: pointer;
    position: relative;
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    width: 24px;
    height: 24px;
    padding: 4px;
    background-color: transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background-color: rgba(16, 185, 129, 0.1);
}

/* Mobile date picker improvements */
@media (max-width: 480px) {
    input[type="date"].form-input {
        font-size: 16px; /* Prevents auto-zoom on iOS */
        padding: 14px 44px 14px 14px;
        min-height: 48px;
    }

    input[type="date"].form-input::-webkit-calendar-picker-indicator {
        width: 28px;
        height: 28px;
        padding: 6px;
    }
}

/* Firefox date input fix */
input[type="date"].form-input::-moz-calendar-picker-indicator {
    opacity: 0.7;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

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

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-btn);
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text-secondary);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.btn-group .btn {
    flex: 1;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: var(--z-toast);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

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

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* LOADING STATES */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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

.loading-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* EMPTY STATE */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* AUTH SCREENS */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

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

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

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

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* Consent checkbox */
.consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.consent-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.consent-checkbox label {
    cursor: pointer;
}

.consent-checkbox a {
    color: var(--primary);
    text-decoration: none;
}

.consent-checkbox a:hover {
    text-decoration: underline;
}

.consent-checkbox.error {
    color: var(--danger);
}

.consent-checkbox.error input[type="checkbox"] {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

/* RESPONSIVE */
@media (min-width: 768px) {
    .app {
        box-shadow: var(--shadow-md);
    }
}

/* Hide for no-cat state */
.no-cat-message {
    padding: 40px 20px;
    text-align: center;
}

.no-cat-message i {
    font-size: 64px;
    color: var(--primary-soft);
    margin-bottom: 16px;
}

.no-cat-message h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.no-cat-message p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Settings */
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-left i {
    font-size: 20px;
    color: var(--primary);
}

.settings-item-label {
    font-size: 14px;
    font-weight: 500;
}

.toggle {
    width: 50px;
    height: 28px;
    background: var(--border);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle.active {
    background: var(--primary);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.toggle.active::after {
    transform: translateX(22px);
}

/* Cat selector in modal */
.cat-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 8px;
}

.cat-select-item:hover {
    background: var(--surface-hover);
}

.cat-select-item.active {
    background: var(--primary-soft);
}

.cat-select-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.cat-select-item-info {
    flex: 1;
}

.cat-select-item-name {
    font-weight: 600;
    font-size: 14px;
}

.cat-select-item-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.cat-select-item-check {
    font-size: 24px;
    color: var(--primary);
}

/* Photo modal */
.photo-preview {
    text-align: center;
    padding: 20px 0;
}

.photo-preview img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}

/* Delete modal */
.delete-modal-content {
    text-align: center;
    padding: 20px 0;
}

.delete-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--danger-soft);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.delete-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.delete-modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ==================== SETTINGS PAGE ==================== */
.settings-page {
    padding: 16px;
    padding-bottom: 100px;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

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

.settings-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.settings-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.settings-profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--primary-glow) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-profile-avatar i {
    font-size: 24px;
    color: var(--primary);
}

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

.settings-profile-name {
    font-weight: 700;
    font-size: 16px;
}

.settings-profile-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Premium Card */
.settings-card.premium-card {
    background: linear-gradient(135deg, #F0EAFF 0%, #E9D8FD 100%);
    border: 1px solid rgba(128, 90, 213, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.settings-card.premium-card:active {
    transform: scale(0.98);
}

.premium-status {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.premium-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--premium) 0%, #9F7AEA 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.premium-icon i {
    font-size: 22px;
    color: white;
}

.premium-info {
    flex: 1;
}

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

.premium-desc {
    font-size: 12px;
    color: #7C3AED;
    opacity: 0.8;
    margin-top: 2px;
}

.premium-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    margin: 0 16px 16px;
    background: var(--premium);
    color: white;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
}

/* Settings Rows */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    min-height: 52px;
}

.settings-row.clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.settings-row.clickable:active {
    background: var(--surface-hover);
}

.settings-row.danger .settings-row-left {
    color: var(--danger);
}

.settings-row.danger .settings-row-left i {
    color: var(--danger);
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.settings-row-left i {
    font-size: 20px;
    color: var(--text-secondary);
    width: 24px;
    text-align: center;
}

.settings-row-value {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.settings-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0 16px;
}

/* Logout Card */
.settings-card.logout-card {
    margin-top: 8px;
    cursor: pointer;
}

.settings-card.logout-card:active {
    background: var(--danger-soft);
}

/* Settings Footer */
.settings-footer {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.settings-footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.settings-footer-logo i {
    font-size: 24px;
}

.settings-footer-text {
    font-size: 12px;
}

/* ==================== ARCHIVE SECTION ==================== */
.archive-section {
    margin-top: 16px;
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.archive-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}

.archive-header:hover {
    background: var(--surface-hover);
}

.archive-header i:first-child {
    font-size: 18px;
    color: var(--text-muted);
}

.archive-chevron {
    margin-left: auto;
    font-size: 16px;
    transition: transform 0.2s;
}

.archive-content {
    border-top: 1px solid var(--border-light);
    padding: 12px;
    background: var(--bg);
}

.archive-content .treatment-card,
.archive-content .list-item {
    opacity: 0.75;
}

.treatment-card.archived {
    opacity: 0.8;
    background: var(--surface-hover);
}

.list-item.archived {
    opacity: 0.75;
    background: var(--surface-hover);
}

.list-item-status.archived {
    background: var(--surface-hover);
    color: var(--text-muted);
}

.list-item-meta-value.archived {
    color: var(--text-muted);
}

.treatment-notes {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin: 8px 14px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.treatment-notes i {
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==================== SETTINGS SCREEN ==================== */
.settings-screen {
    padding: 0;
    padding-bottom: 100px;
}

.settings-screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.settings-screen-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--surface-hover);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.back-btn:active {
    background: var(--border-light);
}

.settings-section {
    padding: 0 16px;
    margin-top: 20px;
}

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

.settings-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
}

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

.settings-row:active {
    background: var(--surface-hover);
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

.settings-icon.premium {
    background: linear-gradient(135deg, #F0EAFF 0%, #E9D8FD 100%);
    color: var(--premium);
}

.settings-icon.veilleur {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: var(--veilleur);
}

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

.settings-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-row-label {
    font-size: 14px;
    font-weight: 500;
}

.settings-row-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-row-value {
    font-size: 13px;
    color: var(--text-muted);
}

.settings-row.danger .settings-row-label {
    color: var(--danger);
}

.settings-footer {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.settings-footer p {
    margin: 4px 0;
}

/* ==================== ACCORDION (Settings) ==================== */
.accordion-trigger {
    cursor: pointer;
}

.accordion-chevron {
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.accordion-chevron.open {
    transform: rotate(180deg);
}

.accordion-content {
    background: var(--bg);
    border-top: 1px solid var(--border-light);
}

.accordion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 52px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: color 0.2s, background 0.2s;
}

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

.accordion-item:hover {
    color: var(--primary);
    background: var(--surface-hover);
}

.accordion-item i {
    font-size: 16px;
    color: var(--text-muted);
}

.accordion-item:hover i {
    color: var(--primary);
}

/* ==================== LIST ITEM NOTES ==================== */
.list-item-notes {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.list-item-notes i {
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 1px;
}

/* Treatment specific colors */
.list-item-status.treatment.ok {
    background: var(--warning-soft);
    color: var(--warning);
}

.list-item.treatment .list-item-meta-value.ok {
    color: var(--warning);
}

/* ==================== COOKIE BANNER ==================== */
.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    padding: 16px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: var(--z-loading); /* Cookie banner au-dessus de tout */
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--border);
}

.cookie-banner.show {
    display: flex;
}

.cookie-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cookie-content i {
    font-size: 24px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.cookie-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.cookie-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.cookie-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.cookie-accept-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

@media (min-width: 480px) {
    .cookie-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .cookie-content {
        flex: 1;
    }

    .cookie-actions {
        flex-shrink: 0;
    }
}

/* ==================== TOGGLE SWITCH ==================== */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: all 0.3s ease;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle.disabled .toggle-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle input:disabled + .toggle-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==================== PAYWALL VEILLEUR ==================== */
.paywall-content {
    padding: 20px;
}

.paywall-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #92400e;
    font-size: 14px;
    font-weight: 500;
}

.paywall-alert i {
    font-size: 20px;
    color: #f59e0b;
}

.paywall-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.paywall-plan {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
}

.paywall-plan.featured {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-color: #f59e0b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.paywall-plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.paywall-plan-header {
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.paywall-plan.featured .paywall-plan-header {
    border-color: rgba(245, 158, 11, 0.3);
}

.paywall-plan-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.paywall-plan-current {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
}

.paywall-plan-price {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #f59e0b;
}

.paywall-plan-price small {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.paywall-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.paywall-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
}

.paywall-features li i {
    font-size: 16px;
    color: var(--success);
}

.paywall-features li.disabled {
    color: var(--text-muted);
    opacity: 0.7;
}

.paywall-features li.disabled i {
    color: var(--danger);
}

.paywall-plan.featured .paywall-features li i {
    color: #f59e0b;
}

.paywall-cta {
    width: 100%;
    margin-top: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    transition: all 0.2s;
}

.paywall-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.paywall-ad-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.paywall-ad-option:hover {
    border-color: #22c55e;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.15);
}

.paywall-ad-option i:first-child {
    font-size: 24px;
    color: #22c55e;
}

.paywall-ad-option span {
    flex: 1;
    font-size: 14px;
    color: #166534;
}

.paywall-ad-option i:last-child {
    color: #22c55e;
}

.paywall-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.paywall-footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.paywall-footer i {
    font-size: 14px;
}

.paywall-later {
    width: 100%;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.paywall-later:hover {
    background: var(--surface-hover);
}

/* Responsive paywall */
@media (max-width: 480px) {
    .paywall-plans {
        grid-template-columns: 1fr;
    }

    .paywall-plan.featured {
        order: -1;
    }
}

/* ==================== VEILLEUR BADGE ==================== */
.veilleur-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.veilleur-badge i {
    font-size: 12px;
}

/* ==================== ACCESSIBILITE & MOBILE ==================== */

/* États tactiles pour mobile */
.btn, button, .header-btn, .nav-item, .card, .clickable {
    -webkit-tap-highlight-color: transparent;
}

.btn:active, button:active, .header-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Classe pour labels accessibles cachés */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible pour accessibilité clavier */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Responsive très petit écran (iPhone SE, etc.) */
@media (max-width: 320px) {
    .app {
        padding: 0 8px;
    }

    .header {
        padding: 0 8px;
    }

    .header-logo span {
        display: none; /* Cacher le texte "CatBox" */
    }

    .header-cat-selector {
        padding: 4px 8px;
        font-size: 12px;
    }

    .header-cat-selector img {
        width: 24px;
        height: 24px;
    }

    .nav-item span {
        font-size: 10px;
    }

    .card {
        padding: 12px;
    }

    .modal {
        padding: 16px;
        border-radius: var(--radius-lg);
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ==================== DESKTOP WARNING (768px+) ==================== */
/* Sur desktop/tablette, on cache l'app et affiche un message */

.desktop-warning {
    display: none;
}

@media (min-width: 768px) {
    .app {
        display: none !important;
    }

    .desktop-warning {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 40px;
        text-align: center;
        background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
        font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    }

    .desktop-warning-icon {
        font-size: 80px;
        margin-bottom: 24px;
    }

    .desktop-warning-title {
        font-size: 28px;
        font-weight: 700;
        color: #1a1a2e;
        margin-bottom: 16px;
    }

    .desktop-warning-text {
        font-size: 16px;
        color: #64748b;
        max-width: 400px;
        line-height: 1.6;
        margin-bottom: 32px;
    }

    .desktop-warning-qr {
        width: 150px;
        height: 150px;
        background: white;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .desktop-warning-qr img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .desktop-warning-url {
        font-size: 14px;
        color: #2D7A6D;
        font-weight: 600;
    }
}

