/* ═══════════════════════════════════════════════════════════════
   TASKFLOW — TOAST SYSTEM v4.0
   Moderne · Professionnel · Léger · Thème Bleu/Blanc
   ═══════════════════════════════════════════════════════════════ */

/* ── Conteneur — haut droite ── */
#tf-toasts {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 360px;
    max-width: calc(100vw - 40px);
    pointer-events: none;
}

/* ── Toast base ── */
.tf-t {
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 14px 16px 14px 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(30, 64, 175, 0.10);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(30, 64, 175, 0.10),
        0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    animation: tf-in 0.30s cubic-bezier(0.34, 1.50, 0.64, 1) both;
    --d: 3800ms;
}

/* Barre de progression en bas */
.tf-t::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    border-radius: 0 0 14px 14px;
    transform-origin: left;
    animation: tf-bar var(--d) linear forwards;
}

/* ── Sortie ── */
.tf-t.tf-out {
    animation: tf-out 0.20s ease forwards;
}

/* ── Icône ── */
.tf-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Corps ── */
.tf-body {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.tf-title {
    margin: 0 0 3px;
    font-size: 0.825rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.tf-msg {
    margin: 0;
    font-size: 0.775rem;
    line-height: 1.5;
    opacity: 0.75;
}

/* ── Bouton fermer ── */
.tf-x {
    flex-shrink: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, opacity 0.15s;
    opacity: 0.35;
    color: inherit;
    padding: 0;
    margin-top: 2px;
}

.tf-x:hover {
    opacity: 1;
    background: rgba(30, 64, 175, 0.07);
}

/* ════════════════════
   VARIANTES
════════════════════ */
.tf-success { border-left: 3px solid #10b981; }
.tf-success .tf-icon  { background: #ecfdf5; color: #059669; }
.tf-success .tf-title { color: #064e3b; }
.tf-success .tf-msg   { color: #065f46; }
.tf-success::after    { background: linear-gradient(90deg, #10b981, #34d399); }

.tf-error { border-left: 3px solid #ef4444; }
.tf-error .tf-icon  { background: #fef2f2; color: #dc2626; }
.tf-error .tf-title { color: #7f1d1d; }
.tf-error .tf-msg   { color: #991b1b; }
.tf-error::after    { background: linear-gradient(90deg, #ef4444, #f87171); }

.tf-warning { border-left: 3px solid #f59e0b; }
.tf-warning .tf-icon  { background: #fffbeb; color: #d97706; }
.tf-warning .tf-title { color: #78350f; }
.tf-warning .tf-msg   { color: #92400e; }
.tf-warning::after    { background: linear-gradient(90deg, #f59e0b, #fcd34d); }

/* Info = couleur principale bleu TaskFlow */
.tf-info { border-left: 3px solid #1e40af; }
.tf-info .tf-icon  { background: #eff6ff; color: #1e40af; }
.tf-info .tf-title { color: #1e3a8a; }
.tf-info .tf-msg   { color: #1e40af; }
.tf-info::after    { background: linear-gradient(90deg, #1e40af, #3b82f6); }

/* ════════════════════
   DARK MODE
════════════════════ */
[data-theme="dark"] .tf-t {
    background: #1a2035;
    border-color: rgba(59, 130, 246, 0.15);
    box-shadow:
        0 2px 4px rgba(0,0,0,.20),
        0 8px 24px rgba(0,0,0,.40);
}
[data-theme="dark"] .tf-x:hover { background: rgba(255,255,255,.08); }

[data-theme="dark"] .tf-success { border-left-color: #10b981; }
[data-theme="dark"] .tf-success .tf-icon  { background: rgba(16,185,129,.12); color: #34d399; }
[data-theme="dark"] .tf-success .tf-title { color: #a7f3d0; }
[data-theme="dark"] .tf-success .tf-msg   { color: #6ee7b7; }

[data-theme="dark"] .tf-error { border-left-color: #ef4444; }
[data-theme="dark"] .tf-error .tf-icon  { background: rgba(239,68,68,.12); color: #f87171; }
[data-theme="dark"] .tf-error .tf-title { color: #fca5a5; }
[data-theme="dark"] .tf-error .tf-msg   { color: #fca5a5; }

[data-theme="dark"] .tf-warning { border-left-color: #f59e0b; }
[data-theme="dark"] .tf-warning .tf-icon  { background: rgba(245,158,11,.12); color: #fbbf24; }
[data-theme="dark"] .tf-warning .tf-title { color: #fde68a; }
[data-theme="dark"] .tf-warning .tf-msg   { color: #fcd34d; }

[data-theme="dark"] .tf-info { border-left-color: #3b82f6; }
[data-theme="dark"] .tf-info .tf-icon  { background: rgba(59,130,246,.12); color: #60a5fa; }
[data-theme="dark"] .tf-info .tf-title { color: #bfdbfe; }
[data-theme="dark"] .tf-info .tf-msg   { color: #93c5fd; }

/* ════════════════════
   ANIMATIONS
════════════════════ */
@keyframes tf-in {
    from { opacity: 0; transform: translateX(calc(100% + 28px)) scale(0.88); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes tf-out {
    to { opacity: 0; transform: translateX(calc(100% + 28px)) scale(0.90); }
}
@keyframes tf-bar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
    #tf-toasts {
        top: 16px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}