/* ==========================================================================
   TIM Paysage · Modern SaaS design system
   Edit this file directly. No build step needed.
   ========================================================================== */

:root {
    --brand-50:  #F4F8F2;
    --brand-100: #E6EFE0;
    --brand-200: #CDE0BF;
    --brand-300: #A8C58F;
    --brand-400: #7FA36B;
    --brand-500: #5E7D4D;
    --brand-600: #4E6A40;
    --brand-700: #3F5A35;
    --brand-800: #2F4228;
    --brand-900: #1F2C1B;

    --surface:       #FFFFFF;
    --surface-muted: #F7F8F6;
    --ink-900: #0F1912;
    --ink-700: #293529;
    --ink-500: #5A6B5A;
    --ink-400: #8A9A8A;
    --border:  #E7ECE4;

    /* Stitch "Curated Landscape" tokens — surface scale + darker primary for Block 2+ */
    --stitch-primary:            #334f2b;
    --stitch-primary-container:  #4a6741;
    --stitch-tertiary:           #424a3e;   /* TPVR entity ribbon */
    --stitch-primary-fixed:      #caecbc;
    --stitch-secondary-container:#d9e3d3;
    --stitch-on-primary-fixed-variant: #324e2a;
    --stitch-on-secondary-container:   #5c6559;

    --surface-bright:            #f8faf7;
    --surface-container-lowest:  #ffffff;
    --surface-container-low:     #f2f4f1;
    --surface-container:         #eceeeb;
    --surface-container-high:    #e7e9e6;
    --surface-container-highest: #e1e3e0;
    --outline-variant:           #c3c8bd;

    --shadow-xs: 0 1px 2px rgba(31, 44, 27, .04);
    --shadow-sm: 0 2px 6px -1px rgba(31, 44, 27, .06), 0 1px 3px -1px rgba(31, 44, 27, .04);
    --shadow-md: 0 8px 20px -8px rgba(63, 90, 53, .18), 0 2px 6px -2px rgba(31, 44, 27, .05);
    --shadow-lg: 0 20px 40px -16px rgba(63, 90, 53, .22), 0 4px 10px -4px rgba(31, 44, 27, .06);
    --shadow-glow: 0 0 0 4px rgba(94, 125, 77, .12);

    --radius-sm: .5rem;
    --radius-md: .75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Base ---------- */
html, body {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    color: var(--ink-900);
    background:
        radial-gradient(1200px 600px at -10% -20%, rgba(127, 163, 107, .10), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(94, 125, 77, .08), transparent 55%),
        var(--brand-50);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(94, 125, 77, .25); }

/* ---------- Buttons ---------- */
.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .18s var(--ease);
    white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-glow); }

.btn-primary {
    background: linear-gradient(180deg, #6B8A5A 0%, #5E7D4D 100%);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -6px rgba(63, 90, 53, .45);
    border: 0;
}
.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 10px 20px -8px rgba(63, 90, 53, .55); }
.btn-primary:active { transform: translateY(0); filter: brightness(.96); }

.btn-secondary {
    background: #fff; color: var(--ink-700);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--ink-900); }

.btn-ghost {
    background: #f2f4f1; color: var(--ink-700); border: 0;
}
.btn-ghost:hover { background: rgba(94, 125, 77, .08); color: var(--brand-700); }

.btn-danger {
    background: linear-gradient(180deg, #E85C5C 0%, #DC2626 100%);
    color: #fff; border: 0;
    box-shadow: 0 6px 16px -6px rgba(220, 38, 38, .45);
}
.btn-danger:hover { transform: translateY(-1px); }

/* Compat aliases for legacy markup */
.btn-primary, .btn-secondary, .btn-danger { display: inline-flex; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card-hover:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-glass {
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(231, 236, 228, .8);
}

/* ---------- Inputs ---------- */
.input {
    display: block; width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem .8rem;
    font-size: .875rem;
    color: var(--ink-900);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
    box-shadow: var(--shadow-xs);
}
.input:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--shadow-glow); }

.label {
    display: block; font-size: .8125rem; font-weight: 500;
    color: var(--ink-700); margin-bottom: .375rem;
    letter-spacing: .01em;
}

/* ---------- Tom Select theming ---------- */
.ts-wrapper {
    --ts-pr-item: .4rem;
    padding: 0 !important;
}
.ts-wrapper .ts-control {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
    font-size: .875rem;
    color: var(--ink-900);
    box-shadow: var(--shadow-xs);
    min-height: 40px;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.ts-wrapper.focus .ts-control,
.ts-wrapper .ts-control:focus {
    border-color: var(--brand-400);
    box-shadow: var(--shadow-glow);
    outline: none;
}
.ts-wrapper.disabled .ts-control { opacity: .55; cursor: not-allowed; background: var(--surface-muted); }

.ts-wrapper .ts-control > input {
    font-size: inherit;
    color: var(--ink-900);
    min-width: 4rem;
    margin: 0 !important;
    padding: 0 !important;
}
.ts-wrapper .ts-control > input::placeholder { color: var(--ink-400); }

/* Multi-select chips */
.ts-wrapper.multi .ts-control > .item {
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-200);
    border-radius: 6px;
    padding: 2px 6px 2px 10px;
    margin: 0;
    font-size: .8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.35;
    box-shadow: none;
    text-shadow: none;
}
.ts-wrapper.multi .ts-control > .item.active {
    background: var(--brand-100);
    border-color: var(--brand-300);
}
.ts-wrapper.multi .ts-control > .item .remove {
    border: 0;
    color: var(--brand-700);
    opacity: .6;
    padding: 0 4px;
    margin-left: 2px;
    font-size: 14px;
    border-radius: 4px;
    transition: opacity .12s, color .12s, background-color .12s;
}
.ts-wrapper.multi .ts-control > .item .remove:hover {
    opacity: 1;
    color: #B91C1C;
    background: rgba(220, 38, 38, .08);
}

/* Dropdown */
.ts-wrapper { position: relative; z-index: 1; }
.ts-wrapper.focus { z-index: 50; } /* lift above neighbouring cards that create stacking contexts via transform */
.ts-dropdown {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 6px;
    padding: .25rem;
    font-size: .875rem;
    color: var(--ink-700);
    animation: pop-in .16s var(--ease);
    /* Must sit above teleported modals (z-index: 9000) because TomSelect uses dropdownParent: 'body'
       — without this the options list is hidden behind the modal backdrop. */
    z-index: 9500 !important;
}
.ts-dropdown .option,
.ts-dropdown .optgroup-header {
    padding: .55rem .7rem;
    border-radius: var(--radius-sm);
    color: var(--ink-700);
    cursor: pointer;
}
.ts-dropdown .optgroup-header {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-400);
    padding-bottom: .25rem;
    cursor: default;
}
.ts-dropdown .option.active,
.ts-dropdown .option:hover {
    background: var(--brand-50);
    color: var(--brand-800);
}
.ts-dropdown .option.selected {
    background: var(--brand-100);
    color: var(--brand-800);
    font-weight: 500;
}
.ts-dropdown .option.selected.active {
    background: var(--brand-200);
}
.ts-dropdown .no-results,
.ts-dropdown .create {
    padding: .75rem .7rem;
    color: var(--ink-500);
    font-size: .8rem;
}
.ts-dropdown .spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid var(--brand-200);
    border-top-color: var(--brand-500);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Single-select clear button */
.ts-wrapper.single .clear-button {
    color: var(--ink-400);
    padding: 0 .4rem;
    font-size: 14px;
    opacity: .7;
}
.ts-wrapper.single .clear-button:hover { opacity: 1; color: #B91C1C; }

.ts-wrapper.single .ts-control > .item {
    color: var(--ink-900);
    padding: 0;
    margin: 0;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .2rem .55rem; border-radius: 9999px;
    font-size: .72rem; font-weight: 600; letter-spacing: .02em;
    border: 1px solid transparent;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; opacity: .7; }
.badge-success { background: #ECFDF3; color: #0B7A3C; border-color: #BBF7D0; }
.badge-warning { background: #FFF6E5; color: #9A4B00; border-color: #FED7AA; }
.badge-danger  { background: #FEF1F1; color: #B91C1C; border-color: #FECACA; }
.badge-info    { background: #EEF4FF; color: #1D4ED8; border-color: #C7D7FE; }
.badge-muted   { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }
.badge-brand   { background: var(--brand-100); color: var(--brand-800); border-color: var(--brand-200); }

/* ---------- Tables ---------- */
.table-clean { min-width: 100%; font-size: .875rem; border-collapse: separate; border-spacing: 0; }
.table-clean thead th {
    padding: .75rem 1rem; text-align: left;
    font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-500);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}
.table-clean thead th:first-child { border-top-left-radius: var(--radius-lg); }
.table-clean thead th:last-child  { border-top-right-radius: var(--radius-lg); }
.table-clean tbody td {
    padding: .9rem 1rem;
    color: var(--ink-700);
    border-bottom: 1px solid var(--border);
}
.table-clean tbody tr { transition: background-color .12s var(--ease); }
.table-clean tbody tr:hover { background: rgba(244, 248, 242, .7); }
.table-clean tbody tr:last-child td { border-bottom: 0; }
.row-actions { opacity: .35; transition: opacity .15s var(--ease); }
.table-clean tbody tr:hover .row-actions { opacity: 1; }
/* Touch devices have no hover — always show row actions. */
@media (hover: none) {
    .row-actions { opacity: 1; }
}

/* ---------- Sidebar & Topbar ---------- */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #3F5A35 0%, #2F4228 100%);
    color: #E6EFE0;
    display: flex; flex-direction: column;
    box-shadow: 4px 0 24px -16px rgba(31, 44, 27, .35);
    flex-shrink: 0;
}
@media (max-width: 1023.98px) {
    .sidebar {
        box-shadow: 8px 0 40px -10px rgba(0, 0, 0, .35);
    }
}
.sidebar::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(600px 400px at 90% -10%, rgba(168, 197, 143, .12), transparent 60%);
}
.sidebar-brand {
    height: 64px; display: flex; align-items: center; gap: .65rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: relative; z-index: 1;
}
.sidebar-brand-logo {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, #7FA36B 0%, #5E7D4D 100%);
    display: grid; place-items: center; color: #fff; font-weight: 700;
    box-shadow: 0 8px 16px -8px rgba(127, 163, 107, .6), inset 0 1px 0 rgba(255,255,255,.25);
}

.sidebar-brand-badge {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 16px -8px rgba(127, 163, 107, .6), inset 0 1px 0 rgba(255,255,255,.25);
    flex-shrink: 0;
    overflow: hidden;
}
.sidebar-nav {
    flex: 1; padding: 1rem .75rem; overflow-y: auto;
    display: flex; flex-direction: column; gap: .2rem;
    position: relative; z-index: 1;
}
.nav-item {
    position: relative;
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .8rem;
    border-radius: var(--radius-sm);
    font-size: .88rem; color: #CDE0BF;
    transition: all .18s var(--ease);
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(127, 163, 107, .22) 0%, rgba(127, 163, 107, .05) 100%);
    color: #fff; font-weight: 500;
}
.nav-item.active::before {
    content: ''; position: absolute; left: -.75rem; top: 20%; bottom: 20%;
    width: 3px; border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #A8C58F, #7FA36B);
    box-shadow: 0 0 12px rgba(168, 197, 143, .5);
}
.nav-item svg { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover svg { opacity: 1; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    height: 64px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid rgba(231, 236, 228, .8);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 .75rem;
    gap: .5rem;
}
@media (min-width: 768px) {
    .topbar { padding: 0 1.5rem; gap: 1rem; }
}

.icon-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    display: grid; place-items: center;
    color: var(--ink-500);
    background: transparent; border: 0;
    transition: background-color .15s var(--ease), color .15s var(--ease);
    cursor: pointer;
}
.icon-btn:hover { background: var(--brand-50); color: var(--brand-700); }
.icon-btn .dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px; border-radius: 9999px;
    background: #EF5B5B; border: 2px solid #fff;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 91, 91, .6); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 91, 91, 0); }
}

.avatar {
    width: 34px; height: 34px; border-radius: 9999px;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #7FA36B 0%, #5E7D4D 100%);
    font-weight: 600; font-size: .78rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}

.dropdown-menu {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: .25rem;
    animation: pop-in .16s var(--ease);
}
@keyframes pop-in {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .7rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    color: var(--ink-700);
    width: 100%; text-align: left;
    transition: background-color .12s var(--ease);
}
.dropdown-item:hover { background: var(--brand-50); color: var(--brand-800); }
.dropdown-item.danger { color: #B91C1C; }
.dropdown-item.danger:hover { background: #FEF1F1; color: #B91C1C; }

/* ---------- Stat card ---------- */
.stat-card {
    position: relative;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fff 0%, rgba(247, 248, 246, .8) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(200px 140px at 100% 0%, rgba(127, 163, 107, .14), transparent 60%);
    pointer-events: none;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
    color: var(--brand-700);
    display: grid; place-items: center;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
.stat-value { font-size: 1.875rem; font-weight: 600; color: var(--ink-900); letter-spacing: -.02em; }
.stat-label { font-size: .8125rem; color: var(--ink-500); }

/* ---------- Timeline (activity) ---------- */
.timeline { position: relative; padding-left: 1.25rem; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--brand-200), transparent); border-radius: 2px; }
.timeline-item { position: relative; padding: .25rem 0 1rem; }
.timeline-item::before { content: ''; position: absolute; left: -1.25rem; top: .55rem; width: 12px; height: 12px; border-radius: 9999px; background: #fff; border: 2px solid var(--brand-400); box-shadow: 0 0 0 3px var(--brand-50); }

/* ---------- Empty state ---------- */
.empty-state {
    padding: 3rem 1.5rem; text-align: center;
    color: var(--ink-500);
}
.empty-state .icon-wrap {
    width: 72px; height: 72px; margin: 0 auto 1rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    display: grid; place-items: center;
    color: var(--brand-500);
}

/* ---------- Animations ---------- */
.animate-in { animation: fade-up .4s var(--ease) both; }
.animate-in-delay-1 { animation-delay: .05s; }
.animate-in-delay-2 { animation-delay: .1s; }
.animate-in-delay-3 { animation-delay: .15s; }
.animate-in-delay-4 { animation-delay: .2s; }
/* Pure opacity fade-in. No transform — adding a transform on the <main>
   element would create a containing block for nested position:fixed modals,
   which breaks their viewport positioning and creates phantom space. */
@keyframes fade-up {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- Auth / Guest ---------- */
.auth-bg {
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(700px 500px at 10% 10%, rgba(127, 163, 107, .35), transparent 60%),
        radial-gradient(700px 500px at 90% 90%, rgba(63, 90, 53, .25), transparent 60%),
        linear-gradient(180deg, #F4F8F2 0%, #E6EFE0 100%);
}
.auth-bg::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(168, 197, 143, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 197, 143, .08) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.auth-card {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(231, 236, 228, .9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.5) inset;
    padding: 2rem;
    transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.auth-card:hover {
    box-shadow: 0 30px 60px -20px rgba(63, 90, 53, .3), 0 0 0 1px rgba(255,255,255,.6) inset;
}
.auth-logo {
    width: 56px; height: 56px; border-radius: 16px;
    background: linear-gradient(135deg, #7FA36B 0%, #3F5A35 100%);
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 1.05rem;
    box-shadow: 0 18px 30px -12px rgba(63, 90, 53, .5), inset 0 1px 0 rgba(255,255,255,.3);
    margin: 0 auto;
}

/* Hero image panel (desktop login split-screen) */
.auth-hero-bg {
    position: absolute; inset: 0;
    background-image: url('/timpaysage/public/assets/backgrounds/background-img3.png');
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    animation: ken-burns 20s ease-in-out infinite alternate;
    filter: saturate(.9);
}
@keyframes ken-burns {
    0%   { transform: scale(1.05) translate(0, 0); }
    100% { transform: scale(1.15) translate(-2%, -2%); }
}
.auth-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(47, 66, 40, .75) 0%, rgba(63, 90, 53, .6) 50%, rgba(94, 125, 77, .55) 100%);
}
.auth-hero-logo img {
    filter: brightness(0) invert(1);
    opacity: .95;
}

/* Floating leaves decoration */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-14px) rotate(6deg); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

/* ---------- Dashboard hero banner ---------- */
.hero-banner {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 180px;
    box-shadow: 0 20px 40px -20px rgba(63, 90, 53, .35);
}
.hero-banner-bg {
    position: absolute; inset: 0;
    background-image: url('/timpaysage/public/assets/backgrounds/background-img7.png');
    background-size: cover;
    background-position: center 40%;
    transform: scale(1.02);
    transition: transform 1.2s var(--ease);
}
.hero-banner:hover .hero-banner-bg {
    transform: scale(1.06);
}
.hero-banner-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(110deg, rgba(31, 44, 27, .82) 0%, rgba(47, 66, 40, .72) 40%, rgba(63, 90, 53, .4) 100%);
}
.hero-leaf {
    position: absolute;
    pointer-events: none;
    opacity: .25;
}
.hero-leaf-1 { top: 12%; right: 8%; width: 52px; height: 52px; }
.hero-leaf-2 { bottom: 16%; right: 25%; width: 34px; height: 34px; opacity: .18; }

/* Playful sidebar nav icon hover */
.nav-item svg { transition: transform .25s var(--ease), opacity .15s var(--ease); }
.nav-item:hover svg { transform: translateX(2px) rotate(-3deg); }

/* Dashboard shortcut tile icon wobble */
.shortcut-tile svg { transition: transform .25s var(--ease); }
.shortcut-tile:hover svg { transform: scale(1.15) rotate(6deg); }

/* ---------- Misc ---------- */
[x-cloak] { display: none !important; }

/* ==========================================================================
   Density preference — applied via <body data-density="compact|cozy|comfortable">
   ========================================================================== */

/* Compact: tighter spacing, denser tables, smaller cards */
body[data-density="compact"] .table-clean thead th { padding: .5rem .8rem; font-size: .68rem; }
body[data-density="compact"] .table-clean tbody td { padding: .55rem .8rem; }
body[data-density="compact"] .card { border-radius: var(--radius-md); }
body[data-density="compact"] .stat-card { padding: .85rem; }
body[data-density="compact"] .stat-value { font-size: 1.5rem; }
body[data-density="compact"] .input { padding: .4rem .65rem; font-size: .82rem; }
body[data-density="compact"] .btn { padding: .4rem .85rem; font-size: .82rem; }
body[data-density="compact"] .badge { padding: .15rem .45rem; font-size: .68rem; }
body[data-density="compact"] main { padding-top: .75rem; padding-bottom: .75rem; }
body[data-density="compact"] main > * + * { margin-top: .75rem; }

/* Comfortable: airier spacing, larger cards, more padding */
body[data-density="comfortable"] .table-clean thead th { padding: 1rem 1.25rem; }
body[data-density="comfortable"] .table-clean tbody td { padding: 1.15rem 1.25rem; }
body[data-density="comfortable"] .stat-card { padding: 1.65rem; }
body[data-density="comfortable"] .stat-value { font-size: 2.15rem; }
body[data-density="comfortable"] .input { padding: .7rem .95rem; }
body[data-density="comfortable"] .btn { padding: .7rem 1.25rem; }
body[data-density="comfortable"] .card { border-radius: var(--radius-xl); }
body[data-density="comfortable"] main { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.scrollbar-slim::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollbar-slim::-webkit-scrollbar-thumb { background: rgba(94, 125, 77, .3); border-radius: 8px; }
.scrollbar-slim::-webkit-scrollbar-thumb:hover { background: rgba(94, 125, 77, .5); }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 1rem 0; }

/* ---------- Toasts (SweetAlert2 custom skin) ---------- */
.swal2-container.swal2-top-end { padding: 1rem !important; }

.swal2-toast.toast {
    background: #fff !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 14px 18px 14px 16px !important;
    font-family: inherit !important;
    min-width: 320px !important;
    max-width: 420px !important;
    position: relative !important;
    overflow: hidden !important;
}
.swal2-toast.toast::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--brand-500);
}
/* Hide the input / textarea / select / actions that SweetAlert2 renders by default inside toasts */
.swal2-toast .swal2-input,
.swal2-toast .swal2-file,
.swal2-toast .swal2-range,
.swal2-toast .swal2-select,
.swal2-toast .swal2-radio,
.swal2-toast .swal2-checkbox,
.swal2-toast .swal2-textarea,
.swal2-toast .swal2-validation-message,
.swal2-toast .swal2-actions,
.swal2-toast .swal2-footer,
.swal2-toast .swal2-close,
.swal2-toast .swal2-loader,
.swal2-toast .swal2-progress-steps,
.swal2-toast .swal2-image,
/* Tom Select artifacts if any got wrapped before the JS guard landed */
.swal2-toast .ts-wrapper,
.swal2-toast .ts-dropdown,
.swal2-popup .ts-wrapper,
.swal2-popup .ts-dropdown {
    display: none !important;
}
.swal2-toast .swal2-html-container:empty { display: none !important; }
.swal2-toast.toast-success::before { background: #16A34A; }
.swal2-toast.toast-error::before   { background: #DC2626; }
.swal2-toast.toast-warning::before { background: #D97706; }
.swal2-toast.toast-info::before    { background: #2563EB; }
.swal2-toast.toast-loading::before { background: var(--brand-500); }

.swal2-toast .swal2-title {
    font-size: .88rem !important;
    font-weight: 500 !important;
    color: var(--ink-900) !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: -.01em !important;
    line-height: 1.4 !important;
}

.swal2-toast .swal2-icon {
    width: 28px !important;
    height: 28px !important;
    margin: 0 12px 0 2px !important;
    border-width: 2px !important;
    flex-shrink: 0;
}
.swal2-toast .swal2-icon .swal2-icon-content { font-size: 1.1rem !important; }
.swal2-toast .swal2-success-ring { width: 28px !important; height: 28px !important; }
.swal2-toast .swal2-success-line-tip,
.swal2-toast .swal2-success-line-long { height: 2px !important; }

.swal2-toast .swal2-timer-progress-bar-container {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important; right: 0 !important;
    height: 2px !important;
    background: transparent !important;
    border-radius: 0 !important;
}
.swal2-toast .swal2-timer-progress-bar {
    background: var(--brand-400) !important;
    opacity: .6 !important;
    border-radius: 0 !important;
}
.swal2-toast.toast-success .swal2-timer-progress-bar { background: #16A34A !important; }
.swal2-toast.toast-error   .swal2-timer-progress-bar { background: #DC2626 !important; }
.swal2-toast.toast-warning .swal2-timer-progress-bar { background: #D97706 !important; }
.swal2-toast.toast-info    .swal2-timer-progress-bar { background: #2563EB !important; }

/* Confirmation modal polish */
.swal2-popup:not(.swal2-toast) {
    border-radius: var(--radius-lg) !important;
    padding: 1.5rem !important;
    font-family: inherit !important;
}
.swal2-popup .swal2-title {
    font-size: 1.125rem !important;
    color: var(--ink-900) !important;
    font-weight: 600 !important;
}
.swal2-popup .swal2-html-container {
    font-size: .875rem !important;
    color: var(--ink-500) !important;
}
.swal2-popup .swal2-actions { gap: .5rem !important; margin-top: 1rem !important; }
.swal2-popup .swal2-confirm,
.swal2-popup .swal2-cancel {
    padding: .55rem 1.1rem !important;
    border-radius: var(--radius-sm) !important;
    font-size: .875rem !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Stitch "Curated Landscape" components — for Block 2+
   ========================================================================== */

.font-headline { font-family: 'Manrope', 'Inter', ui-sans-serif, system-ui, sans-serif; letter-spacing: -.02em; }

/* Material Symbols — explicit font-family + ligature support, defence-in-depth */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined', 'Material Icons', sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.material-symbols-outlined.fill  { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.material-symbols-outlined.sm    { font-size: 16px; }
.material-symbols-outlined.lg    { font-size: 28px; }
.material-symbols-outlined.xl    { font-size: 40px; }

/* Entity ribbon — 4px vertical accent to mark a row/card as TIM vs TPVR */
.entity-ribbon {
    display: inline-block;
    width: 4px;
    flex-shrink: 0;
    border-radius: 9999px;
}
.entity-ribbon-sm  { height: 16px; }
.entity-ribbon-md  { height: 24px; }
.entity-ribbon-lg  { height: 32px; }
.entity-ribbon-tim  { background: var(--stitch-primary); }
.entity-ribbon-tpvr { background: var(--stitch-tertiary); }
.entity-ribbon-auto { /* fallback: uses --entity-color inline style */ background: var(--entity-color, var(--stitch-primary)); }

.entity-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: .72rem; font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.entity-tag-tim  { color: var(--stitch-primary); }
.entity-tag-tpvr { color: var(--stitch-tertiary); }

/* Contract badges (CDI green, CDD softer, Intérim / Apprenti neutral, Stage info) */
.contract-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .25rem .75rem;
    border-radius: 9999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: none;
}
.contract-badge-cdi   { background: var(--stitch-secondary-container); color: var(--stitch-on-secondary-container); }
.contract-badge-cdd   { background: #dce5d6; color: #41493e; }
.contract-badge-int   { background: #fff4e5; color: #8a4b00; }
.contract-badge-app   { background: var(--surface-container-highest); color: var(--ink-700); }
.contract-badge-stg   { background: #e0eaff; color: #1d4ed8; }

/* Status dot + text (Actif / Inactif) */
.status-dot {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .8rem; font-weight: 500;
}
.status-dot::before {
    content: ''; width: 8px; height: 8px; border-radius: 9999px;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 20%, transparent);
}
.status-dot.actif    { color: var(--stitch-primary); }
.status-dot.inactif  { color: var(--outline-variant); }
.status-dot.pending  { color: #D97706; }
.status-dot.expired  { color: #B91C1C; }

/* Stitch-style surface cards (no 1px borders, tonal layering) */
.surface-card {
    background: var(--surface-container-lowest);
    border-radius: 1.5rem; /* rounded-3xl */
    box-shadow: 0 0 0 1px rgba(195, 200, 189, .15);
    overflow: hidden;
}
.surface-card-low  { background: var(--surface-container-low); border-radius: 1.5rem; }
.surface-card-high { background: var(--surface-container-high); border-radius: 1.5rem; }

/* Stitch table */
.stitch-table { width: 100%; text-align: left; border-collapse: collapse; }
.stitch-table thead tr { background: rgba(242, 244, 241, .5); }
.stitch-table thead th {
    padding: 1rem 1.5rem;
    font-family: 'Manrope', sans-serif;
    font-size: .72rem;
    font-weight: 700;
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.stitch-table tbody td { padding: 1rem 1.5rem; color: var(--ink-900); }
.stitch-table tbody tr {
    border-bottom: 1px solid rgba(195, 200, 189, .15);
    transition: background-color .2s var(--ease);
}
.stitch-table tbody tr:hover { background: var(--surface-container-low); }
.stitch-table tbody tr:last-child { border-bottom: 0; }
.stitch-table .row-actions { opacity: 0; transition: opacity .15s var(--ease); }
.stitch-table tbody tr:hover .row-actions { opacity: 1; }
/* Touch devices have no hover — always show row actions. */
@media (hover: none) {
    .stitch-table .row-actions { opacity: 1; }
}

/* Avatar cell: narrow fixed-width column that doesn't inherit the big horizontal padding */
.stitch-table td.avatar-cell,
.stitch-table th.avatar-cell {
    width: 72px;
    min-width: 72px;
    padding: .65rem 0 .65rem 1.5rem !important;
}
.stitch-table .avatar-thumb {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: 0 0 0 2px var(--surface-container-lowest);
    background: #5E7D4D;
    background-image: linear-gradient(135deg, var(--brand-400, #7FA36B), var(--brand-700, #3F5A35));
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    transition: transform .2s var(--ease);
    text-decoration: none;
}
.stitch-table .avatar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.stitch-table tbody tr:hover .avatar-thumb { transform: scale(1.08); }

/* ---------- Compact horizontal scroll strip for icon / color pickers ---------- */
.picker-strip {
    padding: 1rem;
    background: var(--surface-container-low, #F4F8F2);
    border-radius: var(--radius-md, 12px);
    scrollbar-width: thin;
    scrollbar-color: var(--brand-400, #7FA36B) transparent;
}
.picker-strip::-webkit-scrollbar { height: 6px; }
.picker-strip::-webkit-scrollbar-track { background: transparent; }
.picker-strip::-webkit-scrollbar-thumb {
    background: var(--brand-400, #7FA36B);
    border-radius: 9999px;
}
.picker-strip::-webkit-scrollbar-thumb:hover { background: var(--brand-500, #5E7D4D); }

/* ---------- Mini badges + row accents (employee list visual distinctions) ---------- */
.badge-mini {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 7px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-mini-cadre   { background: #4338CA; color: #fff; }
.badge-mini-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.badge-mini-danger  { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* Row left-border accents (4px colored stripe at the start of the row) */
.stitch-table tbody tr.row-cadre       td:first-child { box-shadow: inset 4px 0 0 #4338CA; }
.stitch-table tbody tr.row-provisional td:first-child { box-shadow: inset 4px 0 0 #D97706; }
.stitch-table tbody tr.row-ts-risk     td:first-child { box-shadow: inset 4px 0 0 #DC2626; }
/* If multiple flags apply, danger > provisional > cadre takes precedence */
.stitch-table tbody tr.row-cadre.row-provisional       td:first-child { box-shadow: inset 4px 0 0 #D97706; }
.stitch-table tbody tr.row-cadre.row-ts-risk           td:first-child,
.stitch-table tbody tr.row-provisional.row-ts-risk     td:first-child { box-shadow: inset 4px 0 0 #DC2626; }

/* Stitch bento stat block */
.bento-stat {
    padding: 1.5rem;
    background: var(--surface-container-low);
    border-radius: 1.5rem;
    display: flex; flex-direction: column; gap: .5rem;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.bento-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bento-stat-label {
    font-size: .72rem; font-weight: 700;
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.bento-stat-value {
    font-family: 'Manrope', sans-serif;
    font-size: 2.5rem; font-weight: 800;
    color: var(--ink-900);
    letter-spacing: -.03em;
    line-height: 1;
}
.bento-stat-delta {
    font-size: .75rem; font-weight: 700;
    color: var(--stitch-primary);
}
.bento-stat-highlight {
    background: linear-gradient(135deg, var(--stitch-primary) 0%, var(--stitch-primary-container) 100%);
    color: #fff;
    box-shadow: 0 18px 30px -12px rgba(51, 79, 43, .35);
}
.bento-stat-highlight .bento-stat-label,
.bento-stat-highlight .bento-stat-value,
.bento-stat-highlight .bento-stat-delta { color: #fff; }

/* Stitch primary gradient button (override) */
.btn-stitch {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.5rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--stitch-primary) 0%, var(--stitch-primary-container) 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: .88rem;
    border: 0;
    cursor: pointer;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
    box-shadow: 0 6px 16px -6px rgba(51, 79, 43, .4);
}
.btn-stitch:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -8px rgba(51, 79, 43, .5); }
.btn-stitch:active { transform: translateY(0); filter: brightness(.95); }

.btn-stitch-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--surface-container-high);
    color: var(--ink-900);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: .88rem;
    border: 0;
    cursor: pointer;
    transition: background-color .18s var(--ease);
}
.btn-stitch-secondary:hover { background: var(--surface-container-highest); }

/* Kbd-like chip for keyboard shortcuts */
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; padding: .1rem .35rem; border-radius: .3rem; background: #fff; border: 1px solid var(--border); color: var(--ink-500); box-shadow: 0 1px 0 var(--border); }

/* ==========================================================================
   Form inputs — global restyle (no Tailwind Forms plugin needed)
   ========================================================================== */

/* Textarea inherits .input, add min-height + resize control */
textarea.input { min-height: 88px; resize: vertical; line-height: 1.5; }

/* Number — remove browser spinners */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Date / time — keep native picker, but tint the icon and focus ring */
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], input[type="week"] {
    color-scheme: light;
    font-family: inherit;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .65;
    filter: invert(32%) sepia(22%) saturate(600%) hue-rotate(64deg) brightness(95%);
    transition: opacity .15s var(--ease);
}
input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* Search — hide browser clear button (we use custom) */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { appearance: none; -webkit-appearance: none; }

/* File input */
input[type="file"] {
    display: block;
    width: 100%;
    font-size: .875rem;
    color: var(--ink-700);
    cursor: pointer;
    padding: 0;
    background: transparent;
}
input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: .55rem 1rem;
    border-radius: var(--radius-sm);
    border: 0;
    background: var(--brand-50);
    color: var(--brand-700);
    font-family: inherit;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s var(--ease), color .15s var(--ease);
    box-shadow: inset 0 0 0 1px var(--brand-200);
}
input[type="file"]::file-selector-button:hover {
    background: var(--brand-500);
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--brand-500);
}

/* Custom file input wrapper — drag & drop hint */
.file-dropzone {
    display: flex; align-items: center; gap: 12px;
    padding: 1rem;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.file-dropzone:hover, .file-dropzone.is-dragging {
    border-color: var(--brand-400);
    background: var(--brand-50);
}

/* ---------- Checkbox ---------- */
input[type="checkbox"]:not(.no-theme) {
    appearance: none;
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border: 1.5px solid #CBD5D1;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all .15s var(--ease);
    flex-shrink: 0;
    vertical-align: middle;
    display: inline-grid;
    place-content: center;
    margin: 0;
}
input[type="checkbox"]:not(.no-theme):hover:not(:disabled) { border-color: var(--brand-400); }
input[type="checkbox"]:not(.no-theme):checked {
    background: linear-gradient(180deg, #6B8A5A 0%, #5E7D4D 100%);
    border-color: var(--brand-500);
    box-shadow: 0 2px 4px -1px rgba(63, 90, 53, .3);
}
input[type="checkbox"]:not(.no-theme):checked::after {
    content: '';
    width: 5px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    animation: check-pop .2s var(--ease);
}
@keyframes check-pop {
    0%   { transform: rotate(45deg) scale(0) translate(-1px, -1px); opacity: 0; }
    100% { transform: rotate(45deg) scale(1) translate(-1px, -1px); opacity: 1; }
}
input[type="checkbox"]:not(.no-theme):indeterminate {
    background: linear-gradient(180deg, #6B8A5A 0%, #5E7D4D 100%);
    border-color: var(--brand-500);
}
input[type="checkbox"]:not(.no-theme):indeterminate::after {
    content: ''; width: 10px; height: 2px; background: #fff; border: 0; border-radius: 1px;
    transform: none;
    animation: none;
}
input[type="checkbox"]:not(.no-theme):focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}
input[type="checkbox"]:not(.no-theme):disabled {
    opacity: .5;
    cursor: not-allowed;
    background: #F3F4F6;
}

/* ---------- Radio ---------- */
input[type="radio"]:not(.no-theme) {
    appearance: none;
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border: 1.5px solid #CBD5D1;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all .15s var(--ease);
    flex-shrink: 0;
    vertical-align: middle;
    margin: 0;
}
input[type="radio"]:not(.no-theme):hover:not(:disabled) { border-color: var(--brand-400); }
input[type="radio"]:not(.no-theme):checked {
    border-color: var(--brand-500);
}
input[type="radio"]:not(.no-theme):checked::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: linear-gradient(180deg, #6B8A5A 0%, #5E7D4D 100%);
    animation: check-pop .2s var(--ease);
}
input[type="radio"]:not(.no-theme):focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}
input[type="radio"]:not(.no-theme):disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ---------- Toggle (switch) — for booleans ---------- */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.toggle input[type="checkbox"] {
    position: absolute; opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}
.toggle-track {
    position: relative;
    display: inline-block;
    width: 40px; height: 22px;
    background: #CBD5D1;
    border-radius: 999px;
    flex-shrink: 0;
    transition: background-color .2s var(--ease);
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
    transition: transform .2s var(--ease);
}
.toggle input:checked + .toggle-track {
    background: linear-gradient(180deg, #6B8A5A 0%, #5E7D4D 100%);
}
.toggle input:checked + .toggle-track::after {
    transform: translateX(18px);
}
.toggle input:focus-visible + .toggle-track {
    box-shadow: var(--shadow-glow);
}
.toggle input:disabled + .toggle-track {
    opacity: .5;
    cursor: not-allowed;
}
.toggle-label {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    font-size: .875rem;
    color: var(--ink-800, var(--ink-700));
}
.toggle-label .toggle-hint {
    font-size: .72rem;
    color: var(--ink-500);
    font-weight: 400;
}

/* ---------- Field groups & helpers ---------- */
.field-error {
    display: block;
    font-size: .75rem;
    color: #B91C1C;
    margin-top: 4px;
}
.field-hint {
    display: block;
    font-size: .72rem;
    color: var(--ink-500);
    margin-top: 4px;
}
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
}
.input-group > .input {
    border-radius: 0;
    min-width: 0;
    flex: 1 1 auto;
}
.input-group > .input:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.input-group > .input:last-child  { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.input-addon {
    display: inline-flex; align-items: center;
    padding: 0 .75rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--ink-500);
    font-size: .875rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.input-addon:first-child { border-right: 0; border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.input-addon:last-child  { border-left: 0;  border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }

/* ---------- Password strength indicator ---------- */
.password-strength { font-size: .75rem; }
.ps-bar {
    height: 6px;
    background: #EEF1EC;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.ps-bar-fill {
    height: 100%;
    width: 0;
    background: #E5E7EB;
    border-radius: 999px;
    transition: width .25s var(--ease), background-color .25s var(--ease);
}
.ps-bar-fill.level-1 { background: #EF4444; }
.ps-bar-fill.level-2 { background: #F97316; }
.ps-bar-fill.level-3 { background: #EAB308; }
.ps-bar-fill.level-4 { background: #84CC16; }
.ps-bar-fill.level-5 { background: #16A34A; }
.ps-label {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 6px;
    color: var(--ink-500);
    font-size: .7rem;
}
.ps-label-value { font-weight: 600; color: var(--ink-700); letter-spacing: .02em; }
.ps-bar-fill.level-1 ~ .ps-label .ps-label-value,
.password-strength:has(.ps-bar-fill.level-1) .ps-label-value { color: #B91C1C; }
.password-strength:has(.ps-bar-fill.level-2) .ps-label-value { color: #C2410C; }
.password-strength:has(.ps-bar-fill.level-3) .ps-label-value { color: #A16207; }
.password-strength:has(.ps-bar-fill.level-4) .ps-label-value { color: #4D7C0F; }
.password-strength:has(.ps-bar-fill.level-5) .ps-label-value { color: #15803D; }
.ps-rules {
    list-style: none; padding: 0; margin: 8px 0 0;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4px 14px;
    font-size: .7rem;
}
.ps-rules li {
    position: relative; padding-left: 18px;
    color: var(--ink-500);
    transition: color .2s var(--ease);
}
.ps-rules li::before {
    content: ''; position: absolute; left: 0; top: 3px;
    width: 12px; height: 12px;
    border: 1.5px solid #CBD5D1;
    border-radius: 999px;
    background: #fff;
    transition: all .2s var(--ease);
}
.ps-rules li.ok { color: #15803D; }
.ps-rules li.ok::before {
    background: #16A34A;
    border-color: #16A34A;
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 0 transparent;
}
@media (max-width: 480px) {
    .ps-rules { grid-template-columns: 1fr; }
}

/* ======================================================================
   VISUAL EFFECTS LAYER  ·  Added 2026-05-04
   Ambient + interactive layer. All effects respect prefers-reduced-motion.
   ====================================================================== */

/* --- Floating leaves (ambient) --- */
@keyframes tp-leaf-drift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(18px, 22px) rotate(8deg); }
    50%  { transform: translate(-6px, 38px) rotate(-5deg); }
    75%  { transform: translate(12px, 18px) rotate(4deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}
.tp-floating-leaf {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: 0.16;
    filter: blur(0.3px);
    animation: tp-leaf-drift 22s ease-in-out infinite;
    will-change: transform;
}
[data-theme="dark"] .tp-floating-leaf { opacity: 0.10; }

/* --- Logo breathing (sidebar/topbar) --- */
@keyframes tp-logo-breath {
    0%, 100% { transform: rotate(-1.2deg) scale(1); }
    50%      { transform: rotate(1.2deg) scale(1.025); }
}
.tp-logo-breath {
    animation: tp-logo-breath 7s ease-in-out infinite;
    transform-origin: center;
    will-change: transform;
}

/* --- Hero gradient mesh (animated overlay) --- */
.tp-hero-mesh { position: relative; isolation: isolate; }
.tp-hero-mesh::before,
.tp-hero-mesh::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}
.tp-hero-mesh::before {
    background: radial-gradient(circle at 20% 30%, rgba(202, 236, 188, 0.30), transparent 55%);
    animation: tp-mesh-drift 16s ease-in-out infinite;
}
.tp-hero-mesh::after {
    background: radial-gradient(circle at 80% 70%, rgba(175, 208, 161, 0.22), transparent 55%);
    animation: tp-mesh-drift 22s ease-in-out infinite reverse;
}
.tp-hero-mesh > * { position: relative; z-index: 1; }
@keyframes tp-mesh-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(24px, -12px) scale(1.06); }
    66%      { transform: translate(-18px, 14px) scale(0.96); }
}

/* --- 3D Card tilt --- */
[data-tilt] {
    transform-style: preserve-3d;
    transition: transform 0.18s ease-out, box-shadow 0.25s ease;
    will-change: transform;
}
[data-tilt]:hover {
    box-shadow: 0 18px 40px -12px rgba(51, 79, 43, 0.18);
}
[data-tilt-glare] { position: relative; overflow: hidden; }
[data-tilt-glare]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--tp-glare-x, 50%) var(--tp-glare-y, 50%), rgba(255,255,255,0.35), transparent 35%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    mix-blend-mode: overlay;
}
[data-tilt-glare]:hover::after { opacity: 0.7; }

/* --- Ripple buttons --- */
.tp-ripple-host { position: relative; overflow: hidden; isolation: isolate; }
.tp-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0);
    animation: tp-ripple-out 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes tp-ripple-out {
    to { transform: scale(4); opacity: 0; }
}

/* --- Magnetic buttons --- */
[data-magnetic] {
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    will-change: transform;
}

/* --- Counter pulse --- */
@keyframes tp-counter-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.10); }
    100% { transform: scale(1); }
}
.tp-counter-pulse { animation: tp-counter-pulse 0.5s ease; transform-origin: left center; }

/* --- Reduced motion: kill all ambient + interactive effects --- */
@media (prefers-reduced-motion: reduce) {
    .tp-floating-leaf,
    .tp-logo-breath,
    .tp-hero-mesh::before,
    .tp-hero-mesh::after,
    [data-tilt],
    [data-magnetic] {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    .tp-ripple { display: none; }
}

/* --- Touch devices: disable hover-only effects (no false positives) --- */
@media (hover: none) {
    [data-tilt] { transform: none !important; }
    [data-tilt-glare]::after { display: none; }
    [data-magnetic] { transform: none !important; }
}

/* ======================================================================
   VISUAL EFFECTS — BOLD LAYER  ·  2026-05-04 v2
   Rotating gradient borders, spotlight follow, glow halos, aurora.
   ====================================================================== */

/* @property unlocks rotating conic-gradient backgrounds (Chrome/Edge/Firefox/Safari 16.4+) */
@property --tp-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* --- Rotating gradient border (the "wow" effect) ---
   Apply class .tp-glow-border to any element. Uses a pseudo-element with
   conic-gradient + CSS mask trick to get a clean inner cutout.
*/
.tp-glow-border {
    position: relative;
    isolation: isolate;
}
.tp-glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(
        from var(--tp-angle, 0deg),
        transparent 0deg,
        rgba(127, 163, 107, 0)   50deg,
        var(--stitch-primary, #334f2b) 110deg,
        rgba(175, 208, 161, 0.9) 170deg,
        rgba(202, 236, 188, 0.5) 200deg,
        transparent 260deg
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: tp-rotate-angle 6s linear infinite;
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
    transition: opacity 0.4s ease;
}
.tp-glow-border:hover::before { opacity: 1; }
@keyframes tp-rotate-angle {
    to { --tp-angle: 360deg; }
}

/* --- Spotlight follow on hover ---
   JS sets --mouse-x / --mouse-y. Pure radial gradient, no overhead.
*/
.tp-spotlight {
    position: relative;
    isolation: isolate;
}
.tp-spotlight::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(175, 208, 161, 0.22),
        rgba(127, 163, 107, 0.10) 25%,
        transparent 50%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
    mix-blend-mode: plus-lighter;
}
.tp-spotlight:hover::after { opacity: 1; }

/* --- Glow halo on hover (oversize shadow + colored ring) --- */
.tp-glow-hover {
    transition: box-shadow 0.45s cubic-bezier(0.2, 0.8, 0.3, 1), transform 0.3s ease;
}
.tp-glow-hover:hover {
    box-shadow:
        0 0 0 1px rgba(127, 163, 107, 0.30),
        0 0 28px -4px rgba(94, 125, 77, 0.45),
        0 24px 60px -12px rgba(51, 79, 43, 0.30);
}

/* --- Aurora animated background mesh ---
   Apply .tp-aurora to any container with a primary gradient.
   Adds 3 large blurred radial gradients that drift over time.
*/
.tp-aurora { position: relative; isolation: isolate; overflow: hidden; }
.tp-aurora::before {
    content: '';
    position: absolute;
    inset: -30%;
    z-index: 0;
    background:
        radial-gradient(35% 40% at 18% 28%, rgba(202, 236, 188, 0.55), transparent 70%),
        radial-gradient(40% 35% at 78% 68%, rgba(175, 208, 161, 0.45), transparent 70%),
        radial-gradient(30% 30% at 55% 18%, rgba(127, 163, 107, 0.40), transparent 70%);
    animation: tp-aurora-float 16s ease-in-out infinite alternate;
    filter: blur(30px);
    pointer-events: none;
}
.tp-aurora > * { position: relative; z-index: 1; }
@keyframes tp-aurora-float {
    0%   { transform: translate3d(0, 0, 0) scale(1)    rotate(0deg); }
    50%  { transform: translate3d(8%, -6%, 0) scale(1.08) rotate(4deg); }
    100% { transform: translate3d(-6%, 5%, 0) scale(0.94) rotate(-3deg); }
}

/* --- Icon halo pulse --- */
.tp-icon-halo { position: relative; isolation: isolate; }
.tp-icon-halo::before {
    content: '';
    position: absolute;
    inset: -10px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, currentColor 0%, transparent 65%);
    opacity: 0.18;
    animation: tp-halo-pulse 2.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes tp-halo-pulse {
    0%, 100% { transform: scale(1);    opacity: 0.15; }
    50%      { transform: scale(1.35); opacity: 0.32; }
}

/* --- Shine sweep on hover --- */
.tp-shine { position: relative; overflow: hidden; }
.tp-shine::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 30%,
        rgba(255, 255, 255, 0.45) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 3;
}
.tp-shine:hover::before { transform: translateX(100%); }

/* --- Bento stat cards: stack ALL the effects ---
   Auto-applied via JS so no blade changes needed.
*/
.bento-stat.tp-glow-border::before { opacity: 0.40; }
.bento-stat.tp-glow-border:hover::before { opacity: 0.95; }

/* --- Reduced motion / touch overrides --- */
@media (prefers-reduced-motion: reduce) {
    .tp-glow-border::before,
    .tp-aurora::before,
    .tp-icon-halo::before {
        animation: none !important;
    }
    .tp-shine::before { display: none; }
}
@media (hover: none) {
    .tp-spotlight::after { display: none; }
    .tp-glow-hover:hover { box-shadow: var(--shadow-md, 0 8px 20px -8px rgba(63,90,53,0.18)); }
}

/* ======================================================================
   BENTO-STAT — Override hover for visible 3D feel (additional override)
   The existing rule line 956 only does translateY(-2px); we want more.
   ====================================================================== */
.bento-stat[data-tilt] {
    /* Establish the 3D context + base shadow that intensifies on hover */
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2),
                box-shadow 0.4s ease;
    cursor: pointer;
}
.bento-stat[data-tilt]:not(:hover) { transform: perspective(900px) translateZ(0); }
.bento-stat[data-tilt]:hover {
    /* Strong glow halo even before mouse moves — JS then layers the rotation on top */
    box-shadow:
        0 0 0 1px rgba(127, 163, 107, 0.35),
        0 0 38px -4px rgba(94, 125, 77, 0.55),
        0 30px 60px -16px rgba(51, 79, 43, 0.40) !important;
}

/* Make the conic-gradient border thicker + more visible on bento-stat specifically */
.bento-stat.tp-glow-border::before {
    inset: -3px;
    padding: 3px;
}

/* ======================================================================
   GLOBAL VISUAL LAYER  ·  2026-05-04 v3 — applied app-wide
   Mouse-follow background, cursor glow, link/input/button effects,
   sidebar item glow, table row hover.
   ====================================================================== */

/* Body-level mouse-follow gradient — reacts to cursor position everywhere */
body {
    background:
        radial-gradient(600px circle at var(--tp-mx, 50vw) var(--tp-my, 50vh), rgba(127, 163, 107, 0.12), transparent 30%),
        radial-gradient(1200px 600px at -10% -20%, rgba(127, 163, 107, 0.10), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(94, 125, 77, 0.08), transparent 55%),
        var(--brand-50);
    background-attachment: fixed, fixed, fixed, fixed;
}
[data-theme="dark"] body {
    background:
        radial-gradient(600px circle at var(--tp-mx, 50vw) var(--tp-my, 50vh), rgba(127, 163, 107, 0.10), transparent 30%),
        radial-gradient(1200px 600px at -10% -20%, rgba(127, 163, 107, 0.06), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(94, 125, 77, 0.05), transparent 55%),
        #0b110b !important;
}

/* Soft cursor glow — large blurred circle following the pointer */
.tp-cursor-glow {
    position: fixed;
    pointer-events: none;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(127, 163, 107, 0.20) 0%, rgba(94, 125, 77, 0.10) 30%, transparent 60%);
    transform: translate3d(-50%, -50%, 0);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
    mix-blend-mode: plus-lighter;
    will-change: transform;
    filter: blur(20px);
}
.tp-cursor-glow.tp-cursor-on { opacity: 1; }
@media (hover: none) { .tp-cursor-glow { display: none; } }

/* All <a> links inside content get an animated underline reveal */
main a:not(.btn):not([class*="btn-"]):not(.no-tp-underline) {
    position: relative;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1.5px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
main a:not(.btn):not([class*="btn-"]):not(.no-tp-underline):hover {
    background-size: 100% 1.5px;
}

/* All buttons (not just primary) get a smooth lift on hover */
button:not(:disabled):not(.no-tp-lift),
[role="button"]:not(.no-tp-lift),
.btn:not(:disabled):not(.no-tp-lift) {
    transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2),
                box-shadow 0.25s ease,
                background-color 0.2s ease,
                color 0.2s ease,
                opacity 0.2s ease;
}
button:not(:disabled):not(.no-tp-lift):hover,
[role="button"]:not(.no-tp-lift):hover,
.btn:not(:disabled):not(.no-tp-lift):hover {
    transform: translateY(-1.5px);
}
button:not(:disabled):not(.no-tp-lift):active,
[role="button"]:not(.no-tp-lift):active,
.btn:not(:disabled):not(.no-tp-lift):active {
    transform: translateY(0) scale(0.98);
}

/* Inputs / textareas / selects: animated focus halo */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea,
select {
    transition: border-color 0.2s ease, box-shadow 0.3s ease, background-color 0.2s ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
textarea:focus,
select:focus {
    box-shadow:
        0 0 0 3px rgba(94, 125, 77, 0.18),
        0 0 22px -3px rgba(94, 125, 77, 0.30);
    outline: none;
}

/* Sidebar nav items: glow + slide indicator on hover/active */
.sidebar-green nav a,
aside nav a {
    position: relative;
    transition: background-color 0.25s ease, color 0.25s ease, padding-left 0.25s ease;
}
.sidebar-green nav a::before,
aside nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12%;
    bottom: 12%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--stitch-primary, #334f2b);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.2);
    transform-origin: center;
}
.sidebar-green nav a:hover::before,
aside nav a:hover::before,
.sidebar-green nav a.bg-surface-container-highest::before,
aside nav a.bg-surface-container-highest::before {
    transform: scaleY(1);
}
.sidebar-green nav a:hover,
aside nav a:hover {
    padding-left: calc(0.75rem + 6px);
}

/* Table rows: glow on hover */
table tbody tr {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
table tbody tr:hover {
    box-shadow: inset 4px 0 0 var(--stitch-primary, #334f2b),
                0 1px 0 rgba(94, 125, 77, 0.15);
}

/* Modals backdrop: animate the tint */
@keyframes tp-backdrop-pulse {
    0%, 100% { background-color: rgba(0, 0, 0, 0.50); }
    50%      { background-color: rgba(15, 25, 18, 0.55); }
}
.bg-black\/50.backdrop-blur-sm[role="dialog"] {
    animation: tp-backdrop-pulse 4s ease-in-out infinite;
}

/* Section reveal: every <section> animates in with a stagger */
main section {
    animation: tp-section-in 0.55s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}
main section:nth-of-type(1) { animation-delay: 0.05s; }
main section:nth-of-type(2) { animation-delay: 0.12s; }
main section:nth-of-type(3) { animation-delay: 0.20s; }
main section:nth-of-type(4) { animation-delay: 0.28s; }
main section:nth-of-type(5) { animation-delay: 0.35s; }
@keyframes tp-section-in {
    /* No transform — sections containing modals would create a containing block
       for the modal's position:fixed and break its viewport anchoring. */
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Focus-visible global ring with glow */
*:focus-visible {
    outline: 2px solid var(--stitch-primary, #334f2b);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(127, 163, 107, 0.25);
    transition: outline-offset 0.15s ease, box-shadow 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .tp-cursor-glow { display: none; }
    main section { animation: none !important; }
    .bg-black\/50.backdrop-blur-sm[role="dialog"] { animation: none !important; }
    main a:not(.btn) { background-image: none !important; }
}

/* ======================================================================
   SAAS MESH BACKGROUND  ·  2026-05-04 v4
   Multi-layer animated gradient mesh covering the whole viewport.
   Replaces the pale body background with a vibrant, alive surface.
   ====================================================================== */

/* Override the previous body background to a clean canvas — the mesh layer takes over */
body {
    background: #f7faf5 !important;
}
[data-theme="dark"] body { background: #0b110b !important; }

/* The actual mesh — fixed full-viewport div injected by visual-effects.js */
.tp-bg-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    isolation: isolate;
}
.tp-bg-mesh::before,
.tp-bg-mesh::after,
.tp-bg-mesh > .blob {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}
/* Blob 1 — large sage green, top-left */
.tp-bg-mesh::before {
    width: 55vw;
    height: 55vw;
    top: -15vw;
    left: -10vw;
    background: radial-gradient(circle, rgba(168, 197, 143, 0.55), rgba(168, 197, 143, 0) 70%);
    animation: tp-blob-drift-1 22s ease-in-out infinite alternate;
}
/* Blob 2 — deep forest, bottom-right */
.tp-bg-mesh::after {
    width: 60vw;
    height: 60vw;
    bottom: -20vw;
    right: -15vw;
    background: radial-gradient(circle, rgba(63, 90, 53, 0.40), rgba(63, 90, 53, 0) 70%);
    animation: tp-blob-drift-2 28s ease-in-out infinite alternate;
}
/* Blob 3 — warm earth, center */
.tp-bg-mesh > .blob.b3 {
    width: 48vw;
    height: 48vw;
    top: 15vh;
    left: 35vw;
    background: radial-gradient(circle, rgba(232, 220, 196, 0.45), rgba(232, 220, 196, 0) 70%);
    animation: tp-blob-drift-3 26s ease-in-out infinite alternate;
}
/* Blob 4 — sky tint, top-right */
.tp-bg-mesh > .blob.b4 {
    width: 40vw;
    height: 40vw;
    top: -10vh;
    right: 10vw;
    background: radial-gradient(circle, rgba(184, 212, 227, 0.38), rgba(184, 212, 227, 0) 70%);
    animation: tp-blob-drift-4 24s ease-in-out infinite alternate;
}
/* Blob 5 — bright accent, mouse-follow */
.tp-bg-mesh > .blob.b5 {
    width: 32vw;
    height: 32vw;
    top: var(--tp-my, 50vh);
    left: var(--tp-mx, 50vw);
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(127, 163, 107, 0.30), rgba(127, 163, 107, 0) 70%);
    transition: top 0.4s ease, left 0.4s ease;
    filter: blur(100px);
}

/* Drift animations — each blob has its own drift pattern */
@keyframes tp-blob-drift-1 {
    0%   { transform: translate(0, 0)        scale(1);    }
    100% { transform: translate(8vw, 6vh)    scale(1.12); }
}
@keyframes tp-blob-drift-2 {
    0%   { transform: translate(0, 0)        scale(1);    }
    100% { transform: translate(-10vw, -8vh) scale(0.92); }
}
@keyframes tp-blob-drift-3 {
    0%   { transform: translate(-50%, 0)        scale(1);    }
    100% { transform: translate(-30%, -10vh)    scale(1.08); }
}
@keyframes tp-blob-drift-4 {
    0%   { transform: translate(0, 0)        scale(1);    }
    100% { transform: translate(-6vw, 4vh)   scale(1.10); }
}

/* Dark mode tints */
[data-theme="dark"] .tp-bg-mesh::before {
    background: radial-gradient(circle, rgba(74, 103, 65, 0.45), transparent 70%);
}
[data-theme="dark"] .tp-bg-mesh::after {
    background: radial-gradient(circle, rgba(31, 44, 27, 0.55), transparent 70%);
}
[data-theme="dark"] .tp-bg-mesh > .blob.b3 {
    background: radial-gradient(circle, rgba(94, 125, 77, 0.30), transparent 70%);
}
[data-theme="dark"] .tp-bg-mesh > .blob.b4 {
    background: radial-gradient(circle, rgba(80, 110, 130, 0.25), transparent 70%);
}

/* Make sure the layout root stacks above the mesh, but NEVER touch
   third-party overlays (SweetAlert containers, native dialog, etc.)
   which inject themselves directly into body and rely on their own
   `position: fixed` + z-index. */
/* Layout root: `position: relative` only so it sits above the bg-mesh.
   The exclusions are critical:
   - SweetAlert / TomSelect / mesh / leaves / cursor-glow inject themselves
     directly under <body> with their own positioning and must keep theirs.
   - `[role="dialog"]` (app modals) — when Alpine x-teleports them to <body>
     they become `body > div` too. Without this exclusion the rule would
     override their `position: fixed` with `position: relative`, breaking
     z-index stacking. */
body > div:not(.swal2-container):not(.tp-bg-mesh):not(.tp-cursor-glow):not(.tp-floating-leaf):not(.ts-dropdown):not(.ts-wrapper):not([role="dialog"]) {
    position: relative;
}
.tp-floating-leaf { z-index: 1 !important; }
.tp-cursor-glow   { z-index: 3 !important; }
/* SweetAlert always above everything */
.swal2-container { z-index: 10000 !important; }
/* TomSelect dropdowns are appended to body via dropdownParent:'body' — must
   sit ABOVE app modals (z-index: 9000 — Alpine x-teleport modals) and below SweetAlert (10000). */
.ts-dropdown { z-index: 9500 !important; }

/* Reduced motion: keep the mesh static */
@media (prefers-reduced-motion: reduce) {
    .tp-bg-mesh::before,
    .tp-bg-mesh::after,
    .tp-bg-mesh > .blob {
        animation: none !important;
    }
}

