/* ============================================================
   Tunnelora — Main Stylesheet
   ============================================================ */

:root {
    --tnl-primary:     #6C63FF;
    --tnl-primary-dark:#5A52D5;
    --tnl-accent:      #FF6584;
    --tnl-success:     #2ECC71;
    --tnl-warning:     #F39C12;
    --tnl-danger:      #E74C3C;
    --tnl-dark:        #1A1A2E;
    --tnl-gray:        #6B7280;
    --tnl-gray-light:  #F3F4F6;
    --tnl-white:       #FFFFFF;
    --tnl-border:      #E5E7EB;
    --tnl-shadow:      0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --tnl-shadow-lg:   0 10px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
    --tnl-radius:      12px;
    --tnl-radius-sm:   6px;
    --tnl-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --tnl-sidebar-w:   260px;
}

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

/* ======================== DASHBOARD LAYOUT ======================== */

.tnl-dashboard {
    display: flex;
    min-height: 100vh;
    font-family: var(--tnl-font);
    background: var(--tnl-gray-light);
}

/* ── Email verification banner ── */
.tnl-verify-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #FEF3C7;
    border-bottom: 1px solid #FCD34D;
    font-size: .875rem;
    color: #92400E;
    flex-wrap: wrap;
}
.tnl-verify-banner--success {
    background: #D1FAE5;
    border-bottom-color: #6EE7B7;
    color: #065F46;
}
.tnl-verify-banner__msg { font-size: .8rem; font-weight: 600; }
.tnl-verify-banner__msg--error { color: #DC2626; }
.tnl-verify-banner__btn {
    margin-left: auto;
    background: #D97706;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.tnl-verify-banner__btn:hover { background: #B45309; }
.tnl-verify-banner__btn:disabled { opacity: .7; cursor: default; }

/* Sidebar */
.tnl-sidebar {
    width: var(--tnl-sidebar-w);
    background: var(--tnl-dark);
    color: var(--tnl-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.tnl-sidebar__brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.tnl-sidebar__logo {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--tnl-primary), var(--tnl-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tnl-sidebar__user {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.tnl-sidebar__user strong { font-size: .9rem; display: block; }
.tnl-avatar { border-radius: 50%; }

.tnl-sidebar__nav { padding: 12px 0; flex: 1; }
.tnl-sidebar__nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .9rem;
    transition: all .2s;
}
.tnl-sidebar__nav-item:hover { color: var(--tnl-white); background: rgba(255,255,255,.05); }
.tnl-sidebar__nav-item--active { color: var(--tnl-white); background: rgba(108,99,255,.3); border-right: 3px solid var(--tnl-primary); }
.tnl-sidebar__nav-icon { font-size: 1.1rem; }

.tnl-sidebar__footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.tnl-sidebar__logout { color: rgba(255,255,255,.5); font-size: .85rem; text-decoration: none; display: block; margin-top: 10px; }
.tnl-sidebar__logout:hover { color: var(--tnl-white); }

/* Main */
.tnl-main {
    margin-left: var(--tnl-sidebar-w);
    flex: 1;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ======================== PAGES ======================== */

.tnl-page { padding: 32px; }
.tnl-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.tnl-page__header h1 { font-size: 1.6rem; color: var(--tnl-dark); }
.tnl-page__header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ======================== KPI CARDS ======================== */

.tnl-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.tnl-kpi-card {
    background: var(--tnl-white);
    border-radius: var(--tnl-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--tnl-shadow);
    transition: transform .2s;
}
.tnl-kpi-card:hover { transform: translateY(-2px); }
.tnl-kpi-card--highlight { border-left: 4px solid var(--tnl-primary); }
.tnl-kpi-card__icon { font-size: 1.8rem; }
.tnl-kpi-card__value { font-size: 1.5rem; font-weight: 700; color: var(--tnl-dark); display: block; }
.tnl-kpi-card__label { font-size: .8rem; color: var(--tnl-gray); }

/* ======================== TUNNEL CARDS ======================== */

.tnl-tunnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.tnl-tunnel-card {
    background: var(--tnl-white);
    border-radius: var(--tnl-radius);
    padding: 20px;
    box-shadow: var(--tnl-shadow);
    transition: box-shadow .2s, transform .15s;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.tnl-tunnel-card:hover { box-shadow: var(--tnl-shadow-lg); transform: translateY(-2px); }
.tnl-tunnel-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.tnl-tunnel-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--type-color, #6B7280);
    background: color-mix(in srgb, var(--type-color, #6B7280) 12%, white);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: .02em;
}
.tnl-tunnel-card__name { font-size: 1.05rem; font-weight: 700; color: var(--tnl-dark); margin-bottom: 6px; line-height: 1.3; }
.tnl-tunnel-card__desc { font-size: .83rem; color: var(--tnl-gray); margin-bottom: 14px; line-height: 1.45; }
.tnl-tunnel-card__stats {
    display: flex;
    gap: 0;
    background: #F9FAFB;
    border-radius: 8px;
    padding: 10px 0;
    margin-bottom: 14px;
}
.tnl-stat {
    flex: 1;
    text-align: center;
    border-right: 1px solid #E5E7EB;
}
.tnl-stat:last-child { border-right: none; }
.tnl-stat__value { display: block; font-size: 1.15rem; font-weight: 700; color: var(--tnl-dark); }
.tnl-stat__label { display: block; font-size: .72rem; color: var(--tnl-gray); margin-top: 2px; }
.tnl-tunnel-card__url { display: flex; gap: 6px; margin-bottom: 12px; }
.tnl-tunnel-card__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tnl-tunnel-card__share { border-top: 1px solid var(--tnl-border); padding-top: 10px; margin-top: 4px; }
.tnl-share-btn {
    background: none;
    border: none;
    font-size: .82rem;
    color: var(--tnl-primary);
    cursor: pointer;
    padding: 4px 0;
    font-weight: 600;
}
.tnl-share-btn:hover { text-decoration: underline; }

/* Share modal channels */
.tnl-share-channels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.tnl-share-channel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    transition: opacity .15s;
}
.tnl-share-channel:hover { opacity: .85; }
.tnl-share-channel--whatsapp { background: #DCFCE7; color: #166534; }
.tnl-share-channel--email    { background: #EEF2FF; color: #3730A3; }
.tnl-share-channel--fb       { background: #DBEAFE; color: #1E40AF; }
.tnl-share-channel--linkedin { background: #E0F2FE; color: #0369A1; }

/* Type selector in create modal */
.tnl-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.tnl-type-option { display: flex; }
.tnl-type-option input { display: none; }
.tnl-type-option__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border: 2px solid var(--tnl-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 600;
    width: 100%;
    transition: border-color .15s, background .15s;
    text-align: center;
    color: #374151;
}
.tnl-type-option__icon { font-size: 1.4rem; }
.tnl-type-option input:checked + .tnl-type-option__inner {
    border-color: var(--type-color, var(--tnl-primary));
    background: color-mix(in srgb, var(--type-color, var(--tnl-primary)) 10%, white);
    color: var(--type-color, var(--tnl-primary));
}
.tnl-type-option__inner:hover { border-color: var(--type-color, var(--tnl-primary)); }

/* ======================== TABLES ======================== */

.tnl-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--tnl-white);
    border-radius: var(--tnl-radius);
    overflow: hidden;
    box-shadow: var(--tnl-shadow);
    font-size: .9rem;
}
.tnl-table th { background: var(--tnl-gray-light); padding: 12px 16px; text-align: left; font-weight: 600; color: var(--tnl-dark); font-size: .85rem; }
.tnl-table td { padding: 12px 16px; border-top: 1px solid var(--tnl-border); color: var(--tnl-dark); }
.tnl-table tr:hover td { background: rgba(108,99,255,.03); }

/* ======================== BUTTONS ======================== */

.tnl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--tnl-radius-sm);
    border: none;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.tnl-btn--primary { background: var(--tnl-primary); color: var(--tnl-white); }
.tnl-btn--primary:hover { background: var(--tnl-primary-dark); color: var(--tnl-white); }
.tnl-btn--outline { background: transparent; border: 1.5px solid var(--tnl-primary); color: var(--tnl-primary); }
.tnl-btn--outline:hover { background: var(--tnl-primary); color: var(--tnl-white); }
.tnl-btn--danger { background: transparent; border: 1.5px solid var(--tnl-danger); color: var(--tnl-danger); }
.tnl-btn--danger:hover { background: var(--tnl-danger); color: var(--tnl-white); }
.tnl-btn--sm { padding: 5px 12px; font-size: .8rem; }
.tnl-btn--full { width: 100%; justify-content: center; }
.tnl-btn--upgrade { background: linear-gradient(135deg, #F59E0B, #EF4444); color: var(--tnl-white); }
.tnl-btn--ai { background: linear-gradient(135deg, var(--tnl-primary), var(--tnl-accent)); color: var(--tnl-white); }
.tnl-btn--icon { padding: 6px 10px; }
.tnl-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ======================== BADGES ======================== */

.tnl-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.tnl-badge--basic    { background: #E5E7EB; color: #374151; }
.tnl-badge--pro      { background: #DBEAFE; color: #1D4ED8; }
.tnl-badge--premium  { background: #FDE68A; color: #92400E; }
.tnl-badge--published{ background: #D1FAE5; color: #065F46; }
.tnl-badge--draft    { background: #FEF3C7; color: #92400E; }
.tnl-badge--archived { background: #F3F4F6; color: #6B7280; }

/* ======================== FORMS ======================== */

.tnl-form { }
.tnl-form__group { margin-bottom: 16px; }
.tnl-form__group label { display: block; font-size: .85rem; font-weight: 500; color: var(--tnl-dark); margin-bottom: 6px; }
.tnl-form__group small { font-size: .75rem; color: var(--tnl-gray); }
.tnl-form__input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--tnl-border);
    border-radius: var(--tnl-radius-sm);
    font-size: .9rem;
    color: var(--tnl-dark);
    background: var(--tnl-white);
    transition: border-color .2s;
    outline: none;
}
.tnl-form__input:focus { border-color: var(--tnl-primary); box-shadow: 0 0 0 3px rgba(108,99,255,.1); }
.tnl-form__input--sm { width: auto; min-width: 160px; }
.tnl-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tnl-form__group--inline { display: flex; align-items: center; justify-content: space-between; }
.tnl-form--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.tnl-form--grid .tnl-form__group--full { grid-column: 1 / -1; }
.tnl-form--inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.tnl-form--inline .tnl-form__group { margin-bottom: 0; }

/* ======================== MODALS ======================== */

@keyframes tnlModalBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes tnlModalBoxIn {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tnlModalBoxInMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.tnl-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.tnl-modal[hidden] { display: none !important; }

.tnl-modal__overlay {
    position: absolute; inset: 0;
    background: rgba(10, 10, 28, .58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: tnlModalBackdropIn .2s ease;
}

.tnl-modal__box {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow:
        0 0 0 1px rgba(0,0,0,.055),
        0 8px 20px rgba(0,0,0,.08),
        0 32px 64px rgba(0,0,0,.17);
    animation: tnlModalBoxIn .24s cubic-bezier(.32,1.05,.3,1) both;
}
.tnl-modal__box::-webkit-scrollbar { width: 4px; }
.tnl-modal__box::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.tnl-modal--large  .tnl-modal__box { max-width: 780px; }
.tnl-modal--sm     .tnl-modal__box { max-width: 420px; }
.tnl-modal--danger .tnl-modal__box { border-top: 3px solid var(--tnl-danger); }
.tnl-modal--success .tnl-modal__box { border-top: 3px solid #10B981; }

.tnl-modal__header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 22px;
}
.tnl-modal__header h2,
.tnl-modal__header h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--tnl-dark); line-height: 1.35; }
.tnl-modal__header p  { margin: 4px 0 0; font-size: .85rem; color: var(--tnl-gray); }

.tnl-modal__close {
    flex-shrink: 0;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; cursor: pointer;
    border-radius: 8px; color: var(--tnl-gray);
    font-size: 1.15rem; line-height: 1;
    transition: background .12s, color .12s;
}
.tnl-modal__close:hover { background: #f3f4f6; color: var(--tnl-dark); }

.tnl-modal__footer {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 24px; padding-top: 20px;
    border-top: 1px solid var(--tnl-border);
}

/* ── Admin / automations modal (tnl-modal-overlay pattern) ── */
.tnl-modal-overlay {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(10, 10, 28, .58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: tnlModalBackdropIn .2s ease;
}
.tnl-modal-box {
    background: #fff;
    border-radius: 20px;
    width: 580px; max-width: 96vw; max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 0 0 1px rgba(0,0,0,.055),
        0 8px 20px rgba(0,0,0,.08),
        0 32px 64px rgba(0,0,0,.17);
    animation: tnlModalBoxIn .24s cubic-bezier(.32,1.05,.3,1) both;
}
.tnl-modal-box::-webkit-scrollbar { width: 4px; }
.tnl-modal-box::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }
.tnl-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 24px 18px; border-bottom: 1px solid #f0f0f5;
}
.tnl-modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: #1A1A2E; }
.tnl-modal-close-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    border-radius: 8px; color: #9CA3AF; font-size: 1.1rem;
    transition: background .12s, color .12s;
}
.tnl-modal-close-btn:hover { background: #f3f4f6; color: #1A1A2E; }
.tnl-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px; border-top: 1px solid #f0f0f5; margin-top: 8px;
}

/* ======================== AUTH ======================== */

.tnl-auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 20px; }
.tnl-auth-box { background: var(--tnl-white); border-radius: var(--tnl-radius); padding: 40px; width: 100%; max-width: 440px; box-shadow: var(--tnl-shadow-lg); }
.tnl-auth-logo { text-align: center; margin-bottom: 20px; }
.tnl-auth-logo h2 { font-size: 1.6rem; font-weight: 700; background: linear-gradient(135deg, var(--tnl-primary), var(--tnl-accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tnl-auth-title { font-size: 1.3rem; color: var(--tnl-dark); margin-bottom: 24px; text-align: center; }
.tnl-auth-footer { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--tnl-gray); }
.tnl-auth-footer a { color: var(--tnl-primary); text-decoration: none; }

/* ======================== ALERTS ======================== */

.tnl-alert { padding: 12px 16px; border-radius: var(--tnl-radius-sm); margin-bottom: 16px; font-size: .9rem; }
.tnl-alert--error { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
.tnl-alert--success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }

/* ======================== EMPTY STATES ======================== */

.tnl-empty-state { text-align: center; padding: 60px 20px; }
.tnl-empty-state__icon { font-size: 3rem; display: block; margin-bottom: 16px; }
.tnl-empty-state h3 { font-size: 1.3rem; color: var(--tnl-dark); margin-bottom: 8px; }
.tnl-empty-state p { color: var(--tnl-gray); margin-bottom: 20px; }

/* ======================== EDITOR ======================== */

.tnl-editor__header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.tnl-editor__title { flex: 1; display: flex; align-items: center; gap: 12px; }
.tnl-editor__actions { display: flex; gap: 8px; }
.tnl-back { color: var(--tnl-primary); text-decoration: none; font-size: .9rem; }
.tnl-url-bar { display: flex; align-items: center; gap: 8px; background: var(--tnl-white); padding: 12px 16px; border-radius: var(--tnl-radius); margin-bottom: 24px; box-shadow: var(--tnl-shadow); }
.tnl-url-input { flex: 1; border: none; outline: none; font-size: .85rem; color: var(--tnl-gray); background: transparent; }
.tnl-url-input--full { border: 1.5px solid var(--tnl-border); padding: 8px 12px; border-radius: var(--tnl-radius-sm); }

.tnl-pages-flow { display: flex; flex-direction: column; gap: 0; }
.tnl-page-card { }
.tnl-page-card__arrow { text-align: center; color: var(--tnl-gray); font-size: 1.2rem; padding: 4px 0; }
.tnl-page-card__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--tnl-white);
    border-radius: var(--tnl-radius);
    padding: 16px 20px;
    box-shadow: var(--tnl-shadow);
    transition: box-shadow .2s;
}
.tnl-page-card__inner:hover { box-shadow: var(--tnl-shadow-lg); }
.tnl-page-card__icon { font-size: 1.5rem; }
.tnl-page-card__inner > div:nth-child(2) { flex: 1; }
.tnl-editor-textarea { font-family: monospace; font-size: .85rem; resize: vertical; border-radius: 0 0 8px 8px !important; }
.tnl-editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; background: #f3f4f6; border: 1px solid #e5e7eb; border-bottom: none; border-radius: 8px 8px 0 0; padding: 8px 10px; }
.tnl-editor-tool { background: #fff; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 10px; font-size: .8rem; cursor: pointer; color: #374151; transition: background .15s; }
.tnl-editor-tool:hover { background: #e0e7ff; border-color: #6C63FF; color: #6C63FF; }

/* Template picker */
.tnl-template-picker { padding: 16px 24px 4px; border-bottom: 1px solid #f0f0f0; }
.tnl-template-picker__label { font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: 10px; }
.tnl-template-cards { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
.tnl-template-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    min-width: 110px;
    text-align: center;
    background: #fafafa;
}
.tnl-template-card:hover { border-color: #6C63FF; background: #f5f3ff; }
.tnl-template-card.active { border-color: #6C63FF; background: #ede9fe; }
.tnl-template-card__thumb { font-size: 1.8rem; line-height: 1; }
.tnl-template-card__name { font-size: .8rem; font-weight: 700; color: #1f2937; }
.tnl-template-card__cat { font-size: .7rem; color: #9ca3af; line-height: 1.3; }
.tnl-template-card--none.active { border-color: #9ca3af; background: #f3f4f6; }

.tnl-editor__pages, .tnl-editor__settings { background: var(--tnl-white); border-radius: var(--tnl-radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--tnl-shadow); }
.tnl-editor__pages h2, .tnl-editor__settings h2 { font-size: 1.1rem; color: var(--tnl-dark); margin-bottom: 20px; }

/* ======================== SETTINGS ======================== */

.tnl-settings-section { background: var(--tnl-white); border-radius: var(--tnl-radius); padding: 28px; margin-bottom: 24px; box-shadow: var(--tnl-shadow); }
.tnl-settings-section h2 { font-size: 1.2rem; color: var(--tnl-dark); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.tnl-settings-section.tnl-locked { opacity: .7; }
.tnl-plan-notice { background: #EEF2FF; border: 1px solid #C7D2FE; border-radius: var(--tnl-radius-sm); padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; color: #3730A3; }
.tnl-plan-notice a { color: var(--tnl-primary); font-weight: 600; margin-left: 8px; }

.tnl-payment-method { border: 1.5px solid var(--tnl-border); border-radius: var(--tnl-radius); padding: 16px; margin-bottom: 12px; }
.tnl-toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .95rem; margin-bottom: 0; }
.tnl-method-fields { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tnl-payment-method.tnl-locked { opacity: .5; pointer-events: none; }
.tnl-method-choice { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1.5px solid var(--tnl-border); border-radius: var(--tnl-radius-sm); cursor: pointer; margin-bottom: 8px; }
.tnl-method-choice:has(input:checked) { border-color: var(--tnl-primary); background: rgba(108,99,255,.05); }

/* ======================== MISC ======================== */

.tnl-section { margin-top: 32px; }
.tnl-section h2 { font-size: 1.1rem; color: var(--tnl-dark); margin-bottom: 16px; }
.tnl-notice { background: var(--tnl-gray-light); padding: 16px; border-radius: var(--tnl-radius); color: var(--tnl-gray); }
.tnl-card-element { padding: 12px; border: 1.5px solid var(--tnl-border); border-radius: var(--tnl-radius-sm); margin-bottom: 12px; }
.tnl-saved-msg { color: var(--tnl-success); font-size: .9rem; margin-left: 10px; }

/* ======================== I18N / DETECT ======================== */

.tnl-detect-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #EEF2FF, #F0FDF4);
    border: 1.5px solid #C7D2FE;
    border-radius: var(--tnl-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    gap: 12px;
}
.tnl-detect-banner span { font-size: .9rem; color: #3730A3; }
.tnl-currency-preview {
    margin-top: 6px;
    font-size: .85rem;
    color: var(--tnl-gray);
}
.tnl-currency-preview strong { color: var(--tnl-primary); font-size: 1rem; }

/* ======================== TOAST ======================== */

.tnl-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1A1A2E;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: .9rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all .25s;
    pointer-events: none;
}
.tnl-toast--show { opacity: 1; transform: translateY(0); }
.tnl-toast--success { background: #065F46; }
.tnl-toast--error   { background: #DC2626; }

/* ======================== PROFILE DROPDOWN ======================== */

/* ── Sidebar trigger ─────────────────────────────────────────────── */
.tnl-sidebar__user.tnl-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    border-radius: var(--tnl-radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
    font-family: var(--tnl-font);
    font-size: 1rem;
    color: var(--tnl-white);
}
.tnl-sidebar__user.tnl-profile-trigger:hover { background: rgba(255,255,255,.08); }

.tnl-sidebar__avatar-wrap { position: relative; flex-shrink: 0; }

.tnl-sidebar__user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
}
.tnl-sidebar__user-info strong {
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    display: block;
}

.tnl-sidebar__chevron {
    font-size: 1.1rem;
    opacity: .45;
    transition: transform .2s, opacity .2s;
    flex-shrink: 0;
}
.tnl-profile-trigger[aria-expanded="true"] .tnl-sidebar__chevron {
    transform: rotate(90deg);
    opacity: 1;
}

/* ── Mobile trigger ──────────────────────────────────────────────── */
.tnl-avatar-trigger {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}
.tnl-avatar-trigger .tnl-avatar { border-radius: 50%; }

/* Notification dot (profile incomplete) */
.tnl-avatar-trigger__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #F59E0B;
    border: 2px solid var(--tnl-dark);
    border-radius: 50%;
    z-index: 1;
}
.tnl-sidebar__avatar-wrap .tnl-avatar-trigger__badge {
    border-color: var(--tnl-dark);
}

/* ── Avatar upload (cliquable entièrement) ───────────────────────── */
.tnl-avatar-upload-wrap {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    cursor: pointer;
    border-radius: 50%;
    display: block;
}
.tnl-avatar--lg {
    border-radius: 50%;
    width: 64px !important;
    height: 64px !important;
    object-fit: cover;
    display: block;
}
.tnl-avatar-upload-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.5);
    border-radius: 50%;
    opacity: 0;
    transition: opacity .2s;
    gap: 2px;
}
.tnl-avatar-upload-overlay span { font-size: 1.1rem; line-height: 1; }
.tnl-avatar-upload-overlay small { font-size: .65rem; color: #fff; font-weight: 600; letter-spacing: .02em; }
.tnl-avatar-upload-wrap:hover .tnl-avatar-upload-overlay,
.tnl-avatar-upload-wrap:focus-within .tnl-avatar-upload-overlay { opacity: 1; }

/* ── Dropdown panel ──────────────────────────────────────────────── */
.tnl-profile-dropdown {
    position: fixed;
    left: calc(var(--tnl-sidebar-w, 260px) + 8px);
    bottom: 16px;
    width: 288px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.07),
                0 16px 48px -8px rgba(0,0,0,.18),
                0 0 0 1px rgba(0,0,0,.06);
    z-index: 600;
    overflow: hidden;
    transform-origin: bottom left;
    animation: tnlDropdownIn .16s cubic-bezier(.16,1,.3,1);
}
.tnl-profile-dropdown[hidden] { display: none; }

@keyframes tnlDropdownIn {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);   }
}
@keyframes tnlSheetIn {
    from { transform: translateY(100%); }
    to   { transform: translateY(0);    }
}

/* ── Header ─────────────────────────────────────────────────────── */
.tnl-profile-dropdown__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px 16px;
}

.tnl-profile-dropdown__identity {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tnl-profile-dropdown__identity strong {
    font-size: .925rem;
    font-weight: 700;
    color: var(--tnl-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tnl-profile-dropdown__email {
    font-size: .775rem;
    color: var(--tnl-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Profile completion ──────────────────────────────────────────── */
.tnl-profile-dropdown__completion {
    display: block;
    margin: 0 12px 4px;
    padding: 10px 12px;
    background: #FFF8EE;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    text-decoration: none;
    transition: background .15s;
}
.tnl-profile-dropdown__completion:hover { background: #FFF3D4; }

.tnl-profile-dropdown__completion-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .78rem;
    color: #92400E;
    margin-bottom: 6px;
}
.tnl-profile-dropdown__completion-top strong { font-size: .85rem; }

.tnl-profile-dropdown__completion-track {
    height: 5px;
    background: #FDE68A;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}
.tnl-profile-dropdown__completion-fill {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B, #EF4444);
    border-radius: 99px;
    transition: width .4s ease;
}
.tnl-profile-dropdown__completion-cta {
    display: block;
    font-size: .775rem;
    font-weight: 600;
    color: #B45309;
}

/* ── Plan / usage ────────────────────────────────────────────────── */
.tnl-profile-dropdown__plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 18px;
    background: var(--tnl-gray-light);
    border-top: 1px solid var(--tnl-border);
    border-bottom: 1px solid var(--tnl-border);
    margin-top: 8px;
}
.tnl-profile-dropdown__plan-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tnl-profile-dropdown__plan-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tnl-gray);
    font-weight: 600;
}
.tnl-profile-dropdown__plan-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tnl-profile-dropdown__plan-row strong { font-size: .875rem; color: var(--tnl-dark); }
.tnl-profile-dropdown__usage { font-size: .775rem; color: var(--tnl-gray); }

.tnl-profile-dropdown__upgrade-btn {
    flex-shrink: 0;
    font-size: .775rem;
    font-weight: 700;
    color: var(--tnl-primary);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 99px;
    background: rgba(108,99,255,.1);
    transition: background .15s;
    white-space: nowrap;
}
.tnl-profile-dropdown__upgrade-btn:hover { background: rgba(108,99,255,.2); }

/* ── Separator ───────────────────────────────────────────────────── */
.tnl-profile-dropdown__sep {
    height: 1px;
    background: var(--tnl-border);
    margin: 4px 0;
}

/* ── Menu items ──────────────────────────────────────────────────── */
.tnl-profile-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    font-size: .875rem;
    color: var(--tnl-dark);
    text-decoration: none;
    transition: background .1s;
    -webkit-tap-highlight-color: transparent;
}
.tnl-profile-dropdown__item:hover { background: var(--tnl-gray-light); }
.tnl-profile-dropdown__item-icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.tnl-profile-dropdown__item > span:not(.tnl-profile-dropdown__item-icon):not(.tnl-profile-dropdown__item-arrow) { flex: 1; }
.tnl-profile-dropdown__item-arrow { color: var(--tnl-gray); font-size: 1rem; }

.tnl-profile-dropdown__item--danger { color: var(--tnl-danger); }
.tnl-profile-dropdown__item--danger:hover { background: #FEF2F2; }

/* ── Backdrop ────────────────────────────────────────────────────── */
.tnl-profile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 599;
    background: transparent;
}
.tnl-profile-backdrop[hidden] { display: none; }

body.tnl-no-scroll { overflow: hidden; }

/* ======================== PRE-FLIGHT WARNINGS ======================== */

.tnl-preflight {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    border-left: 4px solid #F59E0B;
    border-radius: var(--tnl-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.tnl-preflight__icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 1px; }

.tnl-preflight__title {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: #92400E;
    margin-bottom: 6px;
}

.tnl-preflight__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tnl-preflight__list li {
    font-size: .85rem;
    color: #78350F;
}

.tnl-preflight__link {
    color: #B45309;
    font-weight: 600;
    text-decoration: underline;
}
.tnl-preflight__link:hover { color: #92400E; }

/* Page status badge */
.tnl-page-status {
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
}
.tnl-page-status--ok    { background: #D1FAE5; color: #065F46; }
.tnl-page-status--empty { background: #FEF3C7; color: #92400E; }

/* Page card info column */
.tnl-page-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tnl-page-card__info small { color: var(--tnl-gray); font-size: .8rem; }

/* Warn state on form inputs */
.tnl-form__input--warn {
    border-color: #F59E0B !important;
    background: #FFFBEB;
}

/* Editor hint (shown when page is empty) */
.tnl-editor-hint {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: var(--tnl-radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .875rem;
    color: #1E40AF;
    line-height: 1.5;
}

.tnl-editor-hint__icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ======================== ONBOARDING CHECKLIST ======================== */

.tnl-onboarding {
    background: #fff;
    border: 1px solid var(--tnl-border);
    border-radius: var(--tnl-radius);
    box-shadow: var(--tnl-shadow);
    padding: 24px 28px 20px;
    margin-bottom: 28px;
    position: relative;
}

.tnl-onboarding__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.tnl-onboarding__title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tnl-onboarding__emoji {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.tnl-onboarding__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tnl-dark);
    margin-bottom: 2px;
}

.tnl-onboarding__subtitle {
    font-size: .82rem;
    color: var(--tnl-gray);
}

.tnl-onboarding__dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tnl-gray);
    font-size: 1rem;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.tnl-onboarding__dismiss:hover { background: var(--tnl-gray-light); color: var(--tnl-dark); }

.tnl-onboarding__progress-wrap {
    height: 6px;
    background: var(--tnl-gray-light);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 20px;
}

.tnl-onboarding__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tnl-primary), var(--tnl-accent));
    border-radius: 99px;
    transition: width .4s ease;
}

.tnl-onboarding__steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px 20px;
}

.tnl-onboarding__step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--tnl-radius-sm);
    background: var(--tnl-gray-light);
    transition: background .15s;
}

.tnl-onboarding__step--done {
    background: #F0FDF4;
}

.tnl-onboarding__step--done .tnl-onboarding__step-label {
    color: #166534;
    text-decoration: line-through;
    opacity: .7;
}

.tnl-onboarding__check {
    flex-shrink: 0;
    font-size: .9rem;
    line-height: 1;
}

.tnl-onboarding__circle {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--tnl-border);
    border-radius: 50%;
}

.tnl-onboarding__step-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tnl-onboarding__step-label {
    font-size: .875rem;
    font-weight: 500;
    color: var(--tnl-dark);
    text-decoration: none;
    flex: 1;
}

a.tnl-onboarding__step-label:hover {
    color: var(--tnl-primary);
}

a.tnl-onboarding__step-label:hover .tnl-onboarding__arrow {
    transform: translateX(3px);
}

.tnl-onboarding__arrow {
    display: inline-block;
    margin-left: 4px;
    transition: transform .15s;
}

/* ======================== MOBILE HEADER ======================== */

.tnl-mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--tnl-dark);
    color: var(--tnl-white);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 300;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.tnl-mobile-header__brand {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--tnl-primary), var(--tnl-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* .tnl-mobile-header__right (legacy alias) — actual styles in .tnl-mobile-header__actions below */

/* ======================== BOTTOM NAV ======================== */

.tnl-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    /* account for iPhone home indicator */
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    background: var(--tnl-white);
    border-top: 1px solid var(--tnl-border);
    z-index: 300;
    box-shadow: 0 -4px 20px rgba(0,0,0,.07);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    align-items: stretch;
}
.tnl-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--tnl-gray);
    font-size: .68rem;
    font-weight: 500;
    padding: 8px 4px;
    transition: color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    min-height: 0;
}
.tnl-bottom-nav__item--active { color: var(--tnl-primary); }
.tnl-bottom-nav__item--active::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 3px;
    background: var(--tnl-primary);
    border-radius: 0 0 4px 4px;
}
.tnl-bottom-nav__item:active { background: var(--tnl-gray-light); }
.tnl-bottom-nav__icon { font-size: 1.4rem; line-height: 1; }
.tnl-bottom-nav__label { letter-spacing: .01em; white-space: nowrap; }

/* ======================== RESPONSIVE — TABLET (≤ 1024px) ======================== */

@media (max-width: 1024px) {
    :root { --tnl-sidebar-w: 220px; }
    .tnl-page { padding: 24px; }
    .tnl-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ======================== RESPONSIVE — MOBILE (≤ 768px) ======================== */

@media (max-width: 768px) {

    /* ── Chrome ─────────────────────────────────── */
    .tnl-mobile-header { display: flex; }
    .tnl-bottom-nav    { display: flex; }
    .tnl-sidebar       { display: none; }

    /* ── Layout ─────────────────────────────────── */
    .tnl-dashboard { flex-direction: column; }
    .tnl-main {
        margin-left: 0;
        padding-top: 64px;
        /* space for bottom nav + iPhone home indicator */
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Page ────────────────────────────────────── */
    .tnl-page { padding: 14px; }
    .tnl-page__header { margin-bottom: 18px; }
    .tnl-page__header h1 { font-size: 1.25rem; }

    /* ── KPI cards: 2 columns ─────────────────── */
    .tnl-kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
    .tnl-kpi-card { padding: 14px 12px; gap: 10px; }
    .tnl-kpi-card__icon { font-size: 1.4rem; }
    .tnl-kpi-card__value { font-size: 1.15rem; }
    .tnl-kpi-card__label { font-size: .72rem; }

    /* ── Tunnel cards: 1 column ───────────────── */
    .tnl-tunnel-grid { grid-template-columns: 1fr; }

    /* ── Tables: horizontal scroll ────────────── */
    .tnl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--tnl-radius); box-shadow: var(--tnl-shadow); }
    .tnl-table { min-width: 560px; box-shadow: none; border-radius: 0; }

    /* ── Forms ────────────────────────────────── */
    .tnl-form--grid { grid-template-columns: 1fr; gap: 0; }
    .tnl-form__row  { grid-template-columns: 1fr; }
    .tnl-form--grid .tnl-form__group--full { grid-column: unset; }

    /* ── Modals: slide-up sheet on mobile ──────── */
    .tnl-modal { align-items: flex-end; padding: 0; }
    .tnl-modal__box {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        padding: 20px 16px;
        animation-name: tnlModalBoxInMobile;
        animation-duration: .3s;
        animation-timing-function: cubic-bezier(.32,1,.3,1);
    }

    /* ── Profile : bottom sheet on mobile ── */
    .tnl-profile-dropdown {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 20px 20px 0 0;
        transform-origin: bottom center;
        animation: tnlSheetIn .28s cubic-bezier(.32,1,.23,1);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    /* Drag handle pill */
    .tnl-profile-dropdown::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #D1D5DB;
        border-radius: 99px;
        margin: 12px auto 0;
    }
    /* Larger touch targets in sheet */
    .tnl-profile-dropdown__item { padding: 15px 20px; font-size: .95rem; }
    .tnl-profile-dropdown__header { padding: 16px 20px; }
    .tnl-profile-dropdown__plan { padding: 12px 20px; }
    .tnl-profile-dropdown__completion { margin: 0 16px 4px; }
    /* Backdrop semi-transparent on mobile */
    .tnl-profile-backdrop { background: rgba(0,0,0,.4); }

    /* ── Bottom sheet items : zones de toucher agrandies ── */
    .tnl-profile-dropdown__item { padding: 15px 20px; font-size: .95rem; }
    .tnl-profile-dropdown__header { padding: 12px 20px 16px; }
    .tnl-profile-dropdown__plan { padding: 12px 20px; }
    .tnl-profile-dropdown__item--danger {
        margin-bottom: 8px;
        font-weight: 600;
    }

    /* ── Onboarding ──────────────────────────── */
    .tnl-onboarding { padding: 16px; }
    .tnl-onboarding__steps { grid-template-columns: 1fr; }

    /* ── Settings sections ───────────────────── */
    .tnl-settings-section { padding: 18px 14px; }
    .tnl-detect-banner { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* ── Plans grid ──────────────────────────── */
    .tnl-plans-grid { grid-template-columns: 1fr !important; }
    .tnl-plan-card--featured { transform: none; }

    /* ── Editor ──────────────────────────────── */
    .tnl-editor__header { flex-direction: column; align-items: flex-start; }
    .tnl-editor__actions { width: 100%; justify-content: flex-end; }

    /* ── Toast: above bottom nav ─────────────── */
    .tnl-toast {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        right: 12px;
        left: 12px;
        text-align: center;
    }

    /* ── Auth ────────────────────────────────── */
    .tnl-auth-box { padding: 28px 18px; }

    /* ── Page header actions: stack on mobile ─ */
    .tnl-page__header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .tnl-page__header-actions { width: 100%; }
    .tnl-page__header-actions .tnl-form__input { width: 100%; }
    .tnl-page__header-actions .tnl-btn { flex: 1; justify-content: center; }

    /* ── Filter bar: stack on mobile ─────────── */
    .tnl-filter-bar { flex-direction: column; align-items: stretch !important; }
    .tnl-filter-bar .tnl-select,
    .tnl-filter-bar input { width: 100% !important; min-width: unset !important; }
}

/* ======================== RESPONSIVE — SMALL (≤ 390px) ======================== */

@media (max-width: 390px) {
    .tnl-bottom-nav__label { font-size: .6rem; }
    .tnl-bottom-nav__icon  { font-size: 1.25rem; }
    .tnl-kpi-grid { grid-template-columns: 1fr; }
    .tnl-kpi-card { flex-direction: row; }
}

/* ======================== MOBILE "PLUS" SHEET ======================== */

/* Hidden off-screen by default on desktop — shown only on mobile */
.tnl-more-sheet {
    display: none; /* desktop: never visible */
}
.tnl-more-sheet-backdrop {
    display: none;
}

@media (max-width: 768px) {
    /* Use transform (not display) to slide in/out so transitions work */
    .tnl-more-sheet {
        display: block;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 500;
        background: var(--tnl-white);
        border-radius: 20px 20px 0 0;
        padding: 0 0 env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -8px 40px rgba(0,0,0,.18);
        transform: translateY(110%);
        transition: transform .28s cubic-bezier(.32,1,.23,1);
        pointer-events: none;
    }
    .tnl-more-sheet.tnl-more-sheet--open {
        transform: translateY(0);
        pointer-events: auto;
    }
    .tnl-more-sheet-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 490;
        background: rgba(0,0,0,.4);
    }
    .tnl-more-sheet-backdrop.tnl-more-sheet-backdrop--open {
        display: block;
    }
}

.tnl-more-sheet__handle {
    width: 40px; height: 4px;
    background: #D1D5DB;
    border-radius: 99px;
    margin: 14px auto 4px;
}
.tnl-more-sheet__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 8px 12px 16px;
}
.tnl-more-sheet__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 4px;
    text-decoration: none;
    color: var(--tnl-dark);
    border-radius: var(--tnl-radius-sm);
    font-size: .75rem;
    font-weight: 500;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.tnl-more-sheet__item:active { background: var(--tnl-gray-light); }
.tnl-more-sheet__item--active { color: var(--tnl-primary); background: rgba(108,99,255,.07); }
.tnl-more-sheet__item span:first-child { font-size: 1.5rem; }

/* ======================== TABLE ACTIONS CELL ======================== */

.tnl-table-actions {
    white-space: nowrap;
}
.tnl-table-actions .tnl-btn {
    margin: 2px 1px;
}

/* ======================== SELECT INPUT ======================== */

.tnl-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--tnl-border);
    border-radius: var(--tnl-radius-sm);
    font-size: .9rem;
    color: var(--tnl-dark);
    background: var(--tnl-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 12px center;
    transition: border-color .2s;
    outline: none;
    cursor: pointer;
    font-family: var(--tnl-font);
}
.tnl-select:focus { border-color: var(--tnl-primary); box-shadow: 0 0 0 3px rgba(108,99,255,.1); }
.tnl-select--sm   { padding: 6px 30px 6px 10px; font-size: .82rem; width: auto; }

/* ======================== SPINNER ======================== */

.tnl-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--tnl-border);
    border-top-color: var(--tnl-primary);
    border-radius: 50%;
    animation: tnlSpin .7s linear infinite;
}
@keyframes tnlSpin { to { transform: rotate(360deg); } }
.tnl-spinner--sm { width: 20px; height: 20px; border-width: 2px; }

/* ======================== CARD ======================== */

.tnl-card {
    background: var(--tnl-white);
    border-radius: var(--tnl-radius);
    padding: 24px;
    box-shadow: var(--tnl-shadow);
    border: 1px solid var(--tnl-border);
}

/* ======================== LABEL ======================== */

.tnl-label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: var(--tnl-dark);
    margin-bottom: 6px;
}

/* ======================== FORM ERROR ======================== */

.tnl-form-error {
    font-size: .82rem;
    color: var(--tnl-danger);
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--tnl-radius-sm);
    padding: 8px 12px;
}

/* ======================== BTN SUCCESS ======================== */

.tnl-btn--success { background: var(--tnl-success); color: var(--tnl-white); border: none; }
.tnl-btn--success:hover { background: #25a25a; color: var(--tnl-white); }

/* ======================== STATUS PILLS ======================== */

.tnl-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .74rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: .01em;
}
.tnl-status--paid      { background: #D1FAE5; color: #065F46; }
.tnl-status--pending   { background: #FEF3C7; color: #92400E; }
.tnl-status--failed,
.tnl-status--cancelled { background: #FEE2E2; color: #991B1B; }
.tnl-status--refunded  { background: #F3F4F6; color: #6B7280; }
.tnl-status--new       { background: #DBEAFE; color: #1D4ED8; }
.tnl-status--contacted { background: #EDE9FE; color: #5B21B6; }
.tnl-status--converted { background: #D1FAE5; color: #065F46; }
.tnl-status--unsub     { background: #F3F4F6; color: #6B7280; }
.tnl-status--active    { background: #D1FAE5; color: #065F46; }
.tnl-status--inactive  { background: #F3F4F6; color: #9CA3AF; }
.tnl-status--sent      { background: #D1FAE5; color: #065F46; }

/* ======================== FILTER BAR ======================== */

.tnl-filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--tnl-white);
    border: 1px solid var(--tnl-border);
    border-radius: var(--tnl-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ======================== STATS BAR ======================== */

.tnl-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.tnl-stat-card {
    background: var(--tnl-white);
    border: 1px solid var(--tnl-border);
    border-radius: var(--tnl-radius);
    padding: 16px 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.tnl-stat-card__value { font-size: 1.35rem; font-weight: 700; color: var(--tnl-dark); display: block; }
.tnl-stat-card__label { font-size: .75rem; color: var(--tnl-gray); margin-top: 3px; display: block; }

/* ======================== CARD ROW (mobile-friendly list) ======================== */

.tnl-card-list { display: flex; flex-direction: column; gap: 10px; }
.tnl-card-row {
    background: var(--tnl-white);
    border: 1px solid var(--tnl-border);
    border-radius: var(--tnl-radius);
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.tnl-card-row__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.tnl-card-row__body   { font-size: .83rem; color: var(--tnl-gray); line-height: 1.5; }
.tnl-card-row__footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--tnl-border); flex-wrap: wrap; }
.tnl-card-row__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ======================== TOGGLE SWITCH ======================== */

.tnl-switch { position: relative; display: inline-block; width: 38px; height: 21px; flex-shrink: 0; }
.tnl-switch input { opacity: 0; width: 0; height: 0; }
.tnl-switch__track {
    position: absolute; cursor: pointer; inset: 0;
    background: #D1D5DB; border-radius: 21px; transition: background .2s;
}
.tnl-switch__track::before {
    content: ''; position: absolute;
    width: 15px; height: 15px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tnl-switch input:checked + .tnl-switch__track { background: var(--tnl-primary); }
.tnl-switch input:checked + .tnl-switch__track::before { transform: translateX(17px); }

/* ======================== PROGRESS BAR ======================== */

.tnl-progress { height: 6px; background: var(--tnl-border); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.tnl-progress__fill { height: 100%; background: linear-gradient(90deg, var(--tnl-primary), var(--tnl-accent)); border-radius: 99px; transition: width .3s; }

/* ======================== RESPONSIVE — STATS BAR ======================== */

@media (max-width: 768px) {
    .tnl-stats-bar { grid-template-columns: 1fr 1fr; gap: 8px; }
    .tnl-stat-card { padding: 12px 14px; }
    .tnl-stat-card__value { font-size: 1.1rem; }
    .tnl-filter-bar { gap: 6px; padding: 10px 12px; }
    .tnl-filter-bar .tnl-select,
    .tnl-filter-bar .tnl-form__input { width: 100% !important; }
}

/* ======================== TAG ======================== */

.tnl-tag {
    display: inline-block;
    font-size: .75rem;
    background: var(--tnl-gray-light);
    border-radius: 4px;
    padding: 1px 5px;
    margin: 1px 2px 1px 0;
    white-space: nowrap;
}

/* ======================== MOBILE FORM GRIDS ======================== */

@media (max-width: 768px) {
    /* Force single-column on any inline-grid form row */
    [style*="grid-template-columns:1fr 2fr"],
    [style*="grid-template-columns: 1fr 2fr"],
    [style*="grid-template-columns:1fr auto auto"],
    [style*="grid-template-columns: 1fr auto auto"] {
        grid-template-columns: 1fr !important;
    }

    /* Filter bars: stack vertically */
    .tnl-filter-bar {
        flex-direction: column;
        align-items: stretch !important;
    }
    .tnl-filter-bar select,
    .tnl-filter-bar input {
        width: 100% !important;
        min-width: unset !important;
    }

    /* Modals: fit inside viewport */
    .tnl-modal__box {
        max-width: calc(100vw - 24px) !important;
        width: 100% !important;
    }

    /* Form grids: always single column on mobile */
    .tnl-form-grid-auto {
        grid-template-columns: 1fr !important;
    }
}

/* ======================== RESPONSIVE — TABLE UTILS ======================== */

/* Any dynamically-built table needs this wrapper to scroll */
.tnl-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--tnl-radius);
    box-shadow: var(--tnl-shadow);
}
.tnl-table-scroll .tnl-table {
    box-shadow: none;
    border-radius: 0;
}

/* Truncate long URLs / emails in table cells */
.tnl-cell-truncate {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (min-width: 769px) {
    .tnl-cell-truncate { max-width: 240px; }
}

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */

/* ── Trigger button ── */
.tnl-bell-trigger {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    color: inherit;
}
.tnl-bell-trigger:hover { background: rgba(255,255,255,.12); }
.tnl-bell-trigger--sidebar { color: #fff; }

/* Badge rouge sur la cloche */
.tnl-bell-badge {
    position: absolute;
    top: 0; right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--tnl-accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    transition: transform .2s, opacity .2s;
}
.tnl-bell-badge--hidden {
    transform: scale(0);
    opacity: 0;
}

/* Mobile header : logo + actions côte à côte */
.tnl-mobile-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Panel (dropdown) ── */
.tnl-bell-panel {
    position: fixed;
    top: 56px; right: 12px;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 520px;
    background: #fff;
    border-radius: var(--tnl-radius);
    box-shadow: var(--tnl-shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 900;
    overflow: hidden;
    animation: tnlBellIn .2s ease;
}
@keyframes tnlBellIn {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tnl-bell-panel[hidden] { display: none; }

.tnl-bell-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--tnl-border);
    flex-shrink: 0;
}
.tnl-bell-panel__header h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--tnl-dark);
}
.tnl-bell-panel__actions { display: flex; gap: 12px; align-items: center; }
.tnl-bell-panel__mark-all {
    background: none; border: none; cursor: pointer;
    font-size: .78rem; color: var(--tnl-primary); font-weight: 600;
}
.tnl-bell-panel__mark-all:hover { text-decoration: underline; }
.tnl-bell-panel__see-all { font-size: .78rem; color: var(--tnl-gray); }
.tnl-bell-panel__see-all:hover { color: var(--tnl-primary); }

.tnl-bell-panel__list {
    overflow-y: auto;
    flex: 1;
}
.tnl-bell-panel__loading {
    display: flex;
    justify-content: center;
    padding: 32px;
}
.tnl-bell-panel__empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--tnl-gray);
    font-size: .9rem;
}
.tnl-bell-panel__empty span { font-size: 2rem; display: block; margin-bottom: 8px; }

/* Backdrop */
.tnl-bell-backdrop {
    position: fixed;
    inset: 0;
    z-index: 899;
}
.tnl-bell-backdrop[hidden] { display: none; }

/* ── Items dans le panel ── */
.tnl-bell-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--tnl-border);
    cursor: pointer;
    transition: background .12s;
    position: relative;
}
.tnl-bell-item:last-child { border-bottom: none; }
.tnl-bell-item:hover { background: var(--tnl-gray-light); }
.tnl-bell-item--unread { background: #f5f3ff; }
.tnl-bell-item--unread:hover { background: #ede9fe; }

.tnl-bell-item__icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.tnl-bell-item__body { flex: 1; min-width: 0; }
.tnl-bell-item__title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--tnl-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}
.tnl-bell-item__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--tnl-primary);
    flex-shrink: 0;
}
.tnl-bell-item__msg {
    font-size: .78rem;
    color: var(--tnl-gray);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tnl-bell-item__time {
    font-size: .72rem;
    color: var(--tnl-gray);
    margin-top: 4px;
    display: block;
}
.tnl-bell-item__del {
    background: none; border: none; cursor: pointer;
    color: var(--tnl-gray); font-size: 1rem;
    opacity: 0; transition: opacity .15s;
    padding: 2px 6px;
    flex-shrink: 0;
    align-self: center;
}
.tnl-bell-item:hover .tnl-bell-item__del { opacity: 1; }
.tnl-bell-item__del:hover { color: var(--tnl-danger); }

/* ── Page notifications ── */
.tnl-notif-page { width: 100%; }

/* Hero */
.tnl-notif-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #6C63FF 0%, #9B8DFF 100%);
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 24px;
    color: #fff;
}
.tnl-notif-hero__left {
    display: flex;
    align-items: center;
    gap: 18px;
}
.tnl-notif-hero__icon-wrap {
    font-size: 2rem;
    width: 56px; height: 56px;
    background: rgba(255,255,255,.18);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tnl-notif-hero__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.tnl-notif-hero__sub {
    font-size: .85rem;
    color: rgba(255,255,255,.82);
    margin: 4px 0 0;
}
.tnl-notif-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 99px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
}
.tnl-notif-hero__cta:hover { background: rgba(255,255,255,.32); color: #fff; }

/* Mobile filter pills (masqués sur desktop) */
.tnl-notif-filters {
    display: none;
    gap: 8px;
    margin-bottom: 20px;
}
.tnl-notif-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    border: 1.5px solid var(--tnl-border);
    color: var(--tnl-gray);
    font-size: .83rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 99px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.tnl-notif-filter:hover { border-color: var(--tnl-primary); color: var(--tnl-primary); }
.tnl-notif-filter--active {
    background: var(--tnl-primary);
    border-color: var(--tnl-primary);
    color: #fff;
}
.tnl-notif-filter--active:hover { background: #5a52d4; border-color: #5a52d4; color: #fff; }
.tnl-notif-filter__badge {
    font-size: .72rem; font-weight: 700;
    background: rgba(0,0,0,.1);
    border-radius: 99px; padding: 1px 7px; line-height: 1.4;
}
.tnl-notif-filter--active .tnl-notif-filter__badge { background: rgba(255,255,255,.25); }
.tnl-notif-filter__badge--accent { background: var(--tnl-accent); color: #fff; }

/* ── Disposition deux colonnes (desktop) ── */
.tnl-notif-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Colonne gauche */
.tnl-notif-aside {
    width: 230px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
}
.tnl-notif-aside__card {
    background: #fff;
    border-radius: 14px;
    border: 1.5px solid var(--tnl-border);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.tnl-notif-aside__heading {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--tnl-gray);
    padding: 16px 16px 8px;
    margin: 0;
}
.tnl-notif-aside__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    font-size: .88rem;
    color: var(--tnl-dark);
    cursor: pointer;
    text-align: left;
    transition: background .12s, color .12s, border-color .12s;
    font-family: var(--tnl-font);
}
.tnl-notif-aside__btn:hover { background: var(--tnl-gray-light); color: var(--tnl-primary); }
.tnl-notif-aside__btn.tnl-notif-filter--active {
    background: #f5f3ff;
    color: var(--tnl-primary);
    border-left-color: var(--tnl-primary);
    font-weight: 600;
}
.tnl-notif-aside__btn-icon { font-size: 1rem; flex-shrink: 0; }
.tnl-notif-aside__count {
    margin-left: auto;
    font-size: .73rem;
    font-weight: 700;
    color: var(--tnl-gray);
    background: var(--tnl-gray-light);
    border-radius: 99px;
    padding: 2px 8px;
    flex-shrink: 0;
}
.tnl-notif-aside__count--accent { background: var(--tnl-accent); color: #fff; }
.tnl-notif-aside__btn.tnl-notif-filter--active .tnl-notif-aside__count {
    background: #ede9fe;
    color: var(--tnl-primary);
}
.tnl-notif-aside__footer {
    padding: 12px 16px;
    border-top: 1px solid var(--tnl-border);
}
.tnl-notif-aside__footer a {
    font-size: .82rem;
    color: var(--tnl-primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tnl-notif-aside__footer a:hover { text-decoration: underline; }
.tnl-notif-aside__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    padding: 0 4px;
    font-size: .75rem;
    color: var(--tnl-gray);
}

/* Colonne principale */
.tnl-notif-main { flex: 1; min-width: 0; }

/* Groups */
.tnl-notif-group { margin-bottom: 8px; }
.tnl-notif-group__label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tnl-gray);
    padding: 4px 0 10px;
}

/* Cards */
.tnl-notif-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 1.5px solid var(--tnl-border);
    transition: box-shadow .15s, border-color .15s, background .12s;
    position: relative;
    cursor: default;
}
.tnl-notif-card:hover {
    box-shadow: 0 4px 16px rgba(108,99,255,.1);
    border-color: #d8d3ff;
}
.tnl-notif-card--unread {
    border-left: 4px solid var(--tnl-primary);
    background: #faf9ff;
}
.tnl-notif-card--unread:hover { background: #f4f2ff; }

.tnl-notif-card__icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.tnl-notif-card__body { flex: 1; min-width: 0; }
.tnl-notif-card__row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tnl-notif-card__title {
    font-size: .92rem;
    font-weight: 600;
    color: var(--tnl-dark);
    flex: 1; min-width: 0;
}
.tnl-notif-card__title a { color: inherit; text-decoration: none; }
.tnl-notif-card__title a:hover { color: var(--tnl-primary); }
.tnl-notif-card__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--tnl-primary);
    flex-shrink: 0;
}
.tnl-notif-card__msg {
    font-size: .84rem;
    color: var(--tnl-gray);
    margin: 5px 0 0;
    line-height: 1.5;
}
.tnl-notif-card__time {
    font-size: .74rem;
    color: #adb5c0;
    margin-top: 6px;
    display: block;
}
.tnl-notif-card__del {
    background: none;
    border: none;
    cursor: pointer;
    color: #c4cad3;
    padding: 6px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s, background .12s, color .12s;
    align-self: center;
}
.tnl-notif-card:hover .tnl-notif-card__del { opacity: 1; }
.tnl-notif-card__del:hover { background: #fef2f2; color: var(--tnl-danger); }

/* Empty */
.tnl-notif-empty {
    text-align: center;
    padding: 64px 24px;
    background: #fff;
    border-radius: 16px;
    border: 1.5px dashed var(--tnl-border);
}
.tnl-notif-empty__icon { font-size: 2.6rem; margin-bottom: 14px; }
.tnl-notif-empty h3 { font-size: 1rem; font-weight: 700; color: var(--tnl-dark); margin: 0 0 6px; }
.tnl-notif-empty p { font-size: .85rem; color: var(--tnl-gray); margin: 0; }

/* Pagination */
.tnl-notif-pagination {
    display: flex; gap: 6px; justify-content: center;
    margin-top: 24px; flex-wrap: wrap;
}
.tnl-notif-pager {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border-radius: 99px; font-size: .83rem; font-weight: 600;
    color: var(--tnl-dark); background: #fff;
    border: 1.5px solid var(--tnl-border);
    text-decoration: none; transition: border-color .15s, color .15s;
}
.tnl-notif-pager:hover { border-color: var(--tnl-primary); color: var(--tnl-primary); }
.tnl-notif-pager--active { background: var(--tnl-primary); border-color: var(--tnl-primary); color: #fff; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .tnl-notif-filters { display: flex; }
    .tnl-notif-layout { display: block; }
    .tnl-notif-aside { display: none; }
    .tnl-notif-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        border-radius: 14px;
        gap: 14px;
        margin-bottom: 16px;
    }
    .tnl-notif-hero__cta { align-self: stretch; justify-content: center; }
    .tnl-notif-card { padding: 14px 16px; border-radius: 12px; }
    .tnl-notif-card__del { opacity: 1; }
}

/* Spinner */
.tnl-spinner {
    display: inline-block;
    width: 24px; height: 24px;
    border: 3px solid var(--tnl-border);
    border-top-color: var(--tnl-primary);
    border-radius: 50%;
    animation: tnlSpin .7s linear infinite;
}
@keyframes tnlSpin { to { transform: rotate(360deg); } }

/* Badge dans la nav sidebar */
.tnl-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--tnl-accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 99px;
    line-height: 1;
    margin-left: 6px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .tnl-bell-panel {
        top: 56px;
        right: 8px;
        width: calc(100vw - 16px);
    }
    .tnl-bell-trigger--sidebar { display: none; }
}

/* ============================================================
   PASSWORD TOGGLE (œil)
   ============================================================ */
.tnl-pw-wrap {
    position: relative;
    display: block;
}
.tnl-pw-wrap .tnl-form__input {
    padding-right: 44px;
}
.tnl-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tnl-gray);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color .15s, background .12s;
    line-height: 1;
}
.tnl-pw-toggle:hover {
    color: var(--tnl-primary);
    background: rgba(108,99,255,.08);
}
.tnl-pw-toggle:focus-visible {
    outline: 2px solid var(--tnl-primary);
    outline-offset: 2px;
}

/* ======================== SETTINGS ACCORDION — ANTI-FOUC =====================
   These rules MUST live in the external stylesheet (loaded in <head>) so they
   apply before the first paint on any device/connection speed.
   The full accordion styles (with transitions) are in settings.php inline, but
   they only ADD transitions — they never change these base max-height values,
   so no animation fires on load.
   =========================================================================== */
.tnl-accordion__body {
    max-height: 0;
    overflow: hidden;
}
.tnl-accordion__item--open .tnl-accordion__body {
    max-height: 5000px;
}
.tnl-accordion__hint {
    max-height: 1.4em;
    opacity: 1;
}
.tnl-accordion__item--open .tnl-accordion__header .tnl-accordion__hint {
    max-height: 0;
    opacity: 0;
}
