:root {
    /* Vert sauge / menthe doux */
    --app-primary: #10b981;
    --app-primary-dark: #059669;
    
    --app-success: #10b981;
    --app-danger: #ef4444;
    --app-warning: #f59e0b;
    --app-bg: #fff;
    --app-card-radius: 16px;
    --app-bottom-nav-height: 68px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.btn-primary {
    background-color: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--app-primary-dark) !important;
    border-color: var(--app-primary-dark) !important;
    color: #ffffff !important;
}

/* Style spécifique pour le gros bouton d'action */
.btn-lg-app {
    padding: 0.8rem 1.25rem;
    font-weight: 600;
    border-radius: var(--app-card-radius);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

* { box-sizing: border-box; }

html, body {
    background: var(--app-bg);
    -webkit-tap-highlight-color: transparent;
}

body {
    padding-bottom: calc(var(--app-bottom-nav-height) + var(--safe-bottom) + 12px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
    border-bottom: 1px solid #e9ecf3;
    padding: 12px 4px;
    padding-top: max(12px, env(safe-area-inset-top));
}

.app-header-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #222;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-header-icon {
    font-size: 1.3rem;
    text-decoration: none;
    padding: 6px 10px;
    color: #222;
}

.app-main {
    min-height: 60vh;
    padding-bottom: 24px;
}

/* ---------- Bottom navigation (type app mobile) ---------- */
.app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--app-bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #e9ecf3;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.app-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #8a94a6;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    height: 100%;
    padding-top: 6px;
}

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

.app-nav-icon { font-size: 1.25rem; line-height: 1; }

.app-nav-item-fab {
    flex: 0 0 62px;
    margin-top: -26px;
}

.app-nav-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
    color: #fff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35); /* Ombres ajustées au vert */
}

/* ---------- Cards ---------- */
.app-card {
    background: #fff;
    border-radius: var(--app-card-radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(20,20,43,0.06);
}

.app-card-hero {
    background: linear-gradient(135deg, #e6f4f1, #dcfce7);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.app-card-hero .stat-label,
.app-card-hero .text-muted {
    color: #15803d !important;
}

.stat-value { font-size: 1.6rem; font-weight: 800; }
.stat-label { font-size: 0.78rem; opacity: 0.85; }

/* ---------- Barres de répartition ---------- */
.part-bar {
    height: 10px;
    border-radius: 6px;
    background: #eef0f6;
    overflow: hidden;
}

.part-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width .4s ease;
}

.avatar-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f1f6;
}

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

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef0f6;
    font-size: 0.78rem;
    font-weight: 600;
}

.category-scroller {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.category-scroller::-webkit-scrollbar {
    display: none;
}

.category-chip-filter {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.category-chip-filter-active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.solde-positif { color: var(--app-success); font-weight: 700; }
.solde-negatif { color: var(--app-danger); font-weight: 700; }

.fab-page-title {
    font-weight: 800;
    font-size: 1.35rem;
    margin: 16px 0 12px;
}

/* Formulaires : grandes zones tactiles */
.form-label { font-weight: 600; font-size: 0.85rem; }
.form-control, .form-select {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 1rem;
}
.btn {
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
}
.btn-lg-app {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
}

.participant-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    background: #fff;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}
.participant-chip .avatar-badge {
    width: 28px;
    height: 28px;
    font-size: 13px;
}

/* ---------- Participant Switcher & Dropdown ---------- */
.participant-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 999px;
    max-width: 100%;
}
.participant-switcher:active {
    background: rgba(0, 0, 0, 0.05);
}
.participant-switcher-name {
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.participant-switcher-caret {
    color: #999;
    font-size: 12px;
}

.participant-dropdown {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 8px;
    min-width: 240px;
}
.participant-dropdown .dropdown-item {
    border-radius: 10px;
    padding: 10px 12px;
    color: #222;
    font-weight: 500;
}
.participant-dropdown .dropdown-item:hover,
.participant-dropdown .dropdown-item:focus {
    background-color: #f1f3f5;
    color: #111;
}
.participant-dropdown .dropdown-item.active,
.participant-dropdown .dropdown-item:active {
    background-color: rgba(16, 185, 129, 0.12) !important; /* Vert léger au lieu du bleu */
    color: var(--app-primary) !important;
    font-weight: 700;
}

@media (min-width: 768px) {
    .container-fluid { max-width: 640px; margin: 0 auto; }
}