/* ================================================================
   ThriveCentral — Design System Frontend (préfixe tc-)
   Basé sur le design system Antigravity (adaptation de mt-)
   ================================================================ */

/* ── Variables ── */
:root {
    --tc-bg:            #eef2f7;
    --tc-white:         #ffffff;
    --tc-sidebar-w:     240px;

    --tc-primary:       #2563EB;
    --tc-primary-light: #EFF6FF;
    --tc-primary-dark:  #1d4ed8;

    --tc-green:         #16A34A;
    --tc-green-light:   #F0FDF4;

    --tc-orange:        #D97706;
    --tc-orange-light:  #FFFBEB;

    --tc-red:           #DC2626;
    --tc-red-light:     #FEF2F2;

    --tc-purple:        #7C3AED;
    --tc-purple-light:  #F5F3FF;

    --tc-cyan:          #00b4d8;
    --tc-cyan-light:    #E0F9FD;

    --tc-text:          #1e293b;
    --tc-text-soft:     #64748b;

    --tc-border:        #e2e8f0;
    --tc-shadow:        0 2px 12px rgba(0,0,0,.07);
    --tc-shadow-md:     0 4px 20px rgba(0,0,0,.10);
    --tc-radius:        14px;
    --tc-radius-sm:     8px;
    --tc-font:          -apple-system,'Inter',BlinkMacSystemFont,'Segoe UI',sans-serif;
}

/* ── Reset isolation WordPress ── */
.tc-app *, .tc-app *::before, .tc-app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.tc-app h1, .tc-app h2, .tc-app h3, .tc-app h4 { font-family: var(--tc-font); }
.tc-app a { color: var(--tc-primary); }
.tc-app img { max-width: 100%; }
.tc-app button { font-family: var(--tc-font); }
.tc-app ul { list-style: none; }

/* ── Layout principal ── */
.tc-app {
    font-family: var(--tc-font);
    display: flex;
    min-height: 700px;
    background: var(--tc-bg);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.12);
    position: relative;
    color: var(--tc-text);
}

/* ── Sidebar ── */
.tc-sidebar {
    width: var(--tc-sidebar-w);
    min-width: var(--tc-sidebar-w);
    background: var(--tc-white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--tc-border);
    flex-shrink: 0;
}

.tc-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--tc-border);
}
.tc-sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-sidebar-logo-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--tc-text);
    line-height: 1.2;
}
.tc-sidebar-logo-text span {
    font-size: 11px;
    color: var(--tc-text-soft);
}

/* Navigation */
.tc-sidebar-nav {
    flex: 1;
    padding: 8px 10px;
    overflow-y: auto;
}
.tc-nav-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--tc-text-soft);
    padding: 14px 8px 5px;
    display: block;
    border-top: 1px solid var(--tc-border);
}
.tc-sidebar-nav > .tc-nav-section:first-child { border-top: none; padding-top: 6px; }

.tc-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--tc-text-soft);
    font-size: 13.5px;
    font-weight: 500;
    transition: all .18s;
    margin-bottom: 2px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
}
.tc-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
.tc-nav-item:hover { background: var(--tc-bg); color: var(--tc-text); }
.tc-nav-item.active {
    background: var(--tc-primary-light);
    color: var(--tc-primary);
    font-weight: 600;
}
.tc-nav-item.active svg { stroke: var(--tc-primary); }

.tc-nav-badge {
    margin-left: auto;
    background: var(--tc-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.tc-nav-badge-soft {
    margin-left: auto;
    background: var(--tc-bg);
    color: var(--tc-text-soft);
    font-size: 11px;
    font-weight: 600;
    min-width: 22px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.tc-nav-plugin-item { opacity: .85; cursor: default; padding-right: 4px; }
.tc-nav-plugin-item:hover { background: none; }
.tc-nav-plugin-connected { margin-left: auto; flex-shrink: 0; color: var(--tc-green); }
.tc-nav-plugin-item .tc-nav-plugin-connected { width: 15px; height: 15px; display: block; }
.tc-nav-plugin-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.tc-nav-plugin-dot.blue   { background: var(--tc-primary); }
.tc-nav-plugin-dot.green  { background: var(--tc-green); }
.tc-nav-plugin-dot.orange { background: var(--tc-orange); }
.tc-nav-plugin-dot.purple { background: var(--tc-purple); }
.tc-nav-plugin-dot.red    { background: var(--tc-red); }
.tc-nav-plugin-dot.cyan   { background: var(--tc-cyan); }
.tc-nav-plugin-empty { font-size: 12px; color: var(--tc-text-soft); opacity: .6; cursor: default; }
.tc-nav-plugin-empty:hover { background: none; }

/* Bloc utilisateur */
.tc-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--tc-border);
    background: var(--tc-bg);
}
.tc-sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.tc-sidebar-user-role {
    font-size: 11px;
    color: var(--tc-text-soft);
}
.tc-sidebar-logout {
    margin-left: auto;
    color: var(--tc-text-soft);
    opacity: .5;
    transition: opacity .18s;
    flex-shrink: 0;
}
.tc-sidebar-logout:hover { opacity: 1; color: var(--tc-red); }

/* ── Zone contenu ── */
.tc-content {
    flex: 1;
    overflow-y: auto;
    background: var(--tc-bg);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
/* ═══════════════════════════════════════════════════════════════
   Header sticky — scoping .tc-app pour battre le CSS du thème.
   !important sur les propriétés de layout critiques.
   ═══════════════════════════════════════════════════════════════ */
.tc-app .tc-content-header {
    background: var(--tc-white) !important;
    border-bottom: 1px solid var(--tc-border) !important;
    padding: 0 24px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    min-height: 64px !important;
    box-sizing: border-box !important;
}

/* Colonne gauche : toggle + titre */
.tc-app .tc-header-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
    padding: 0 20px 0 0 !important;
}
.tc-app .tc-content-header h1 {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--tc-text) !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}
.tc-app .tc-header-sub {
    font-size: 12px !important;
    color: var(--tc-text-soft) !important;
    margin-top: 2px !important;
    white-space: nowrap !important;
}

/* Séparateur vertical entre sections */
.tc-app .tc-header-sep {
    width: 1px !important;
    align-self: stretch !important;
    background: var(--tc-border) !important;
    flex-shrink: 0 !important;
    margin: 10px 0 !important;
}

/* Colonne centre : boutons plugins */
.tc-app .tc-header-plugins {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    padding: 0 16px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    align-self: center !important;
}
.tc-app .tc-header-plugins::-webkit-scrollbar { display: none !important; }

/* Bouton plugin — reset complet puis re-style */
.tc-app .tc-plugin-shortcut {
    /* reset des surcharges thème */
    all: unset !important;
    /* layout */
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 7px !important;
    flex-shrink: 0 !important;
    /* apparence — fond coloré par défaut (variante blue) */
    padding: 7px 15px 7px 11px !important;
    border-radius: 20px !important;
    border: none !important;
    background: var(--tc-primary) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: filter 0.18s ease, background 0.18s ease !important;
}
/* Hover : légèrement plus foncé */
.tc-app .tc-plugin-shortcut:hover,
.tc-app .tc-plugin-shortcut:focus {
    color: #fff !important;
    outline: none !important;
    filter: brightness(.82) !important;
}
/* Variantes couleur — état par défaut */
.tc-app .tc-plugin-shortcut--green  { background: var(--tc-green)  !important; }
.tc-app .tc-plugin-shortcut--orange { background: var(--tc-orange) !important; }
.tc-app .tc-plugin-shortcut--purple { background: var(--tc-purple) !important; }
/* Variantes couleur — hover */
.tc-app .tc-plugin-shortcut--green:hover,
.tc-app .tc-plugin-shortcut--green:focus,
.tc-app .tc-plugin-shortcut--orange:hover,
.tc-app .tc-plugin-shortcut--orange:focus,
.tc-app .tc-plugin-shortcut--purple:hover,
.tc-app .tc-plugin-shortcut--purple:focus  { filter: brightness(.82) !important; outline: none !important; }

/* Icone : boîte rigide 16×16 */
.tc-app .tc-plugin-shortcut-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 16px !important;
    height: 16px !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* Override du reset SVG global des thèmes : max-width:100%, height:auto */
.tc-app .tc-plugin-shortcut-icon svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0 !important;
}
.tc-app .tc-plugin-shortcut-name {
    display: block !important;
    line-height: 1 !important;
}

/* Colonne droite : actions (cloche) */
.tc-app .tc-header-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    padding: 0 0 0 20px !important;
}

/* Mobile */
@media (max-width: 768px) {
    .tc-app .tc-content-header { padding: 0 16px !important; }
    .tc-app .tc-header-left    { padding-right: 12px !important; }
    .tc-app .tc-header-sep     { display: none !important; }
    .tc-app .tc-header-plugins { padding: 0 8px !important; gap: 6px !important; }
    .tc-app .tc-plugin-shortcut { padding: 8px !important; border-radius: 50% !important; gap: 0 !important; }
    .tc-app .tc-plugin-shortcut-name { display: none !important; }
    .tc-app .tc-header-actions { padding-left: 8px !important; }
}
.tc-content-body {
    padding: 22px 24px 40px;
    flex: 1;
}

/* Bouton menu mobile */
.tc-menu-toggle {
    display: none;
    background: var(--tc-white);
    border: 1px solid var(--tc-border);
    border-radius: 8px;
    padding: 7px 9px;
    cursor: pointer;
    align-items: center;
    color: var(--tc-text);
}

/* ── Bouton cloche notif ── */
.tc-header-notif-btn {
    position: relative;
    background: none;
    border: 1.5px solid var(--tc-border);
    border-radius: 10px;
    padding: 7px 9px;
    cursor: pointer;
    color: var(--tc-text-soft);
    transition: all .18s;
}
.tc-header-notif-btn:hover { border-color: var(--tc-primary); color: var(--tc-primary); }
.tc-header-notif-dot {
    position: absolute;
    top: 5px; right: 5px;
    width: 8px; height: 8px;
    background: var(--tc-red);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Popover notifications */
.tc-notif-popover {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow-md);
    border: 1px solid var(--tc-border);
    z-index: 999;
    overflow: hidden;
}
.tc-notif-popover.open { display: block; }
.tc-notif-popover-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--tc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--tc-text);
}
.tc-notif-popover-body { max-height: 340px; overflow-y: auto; }
.tc-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--tc-border);
    cursor: pointer;
    transition: background .15s;
}
.tc-notif-item:last-child { border-bottom: none; }
.tc-notif-item:hover { background: var(--tc-bg); }
.tc-notif-item.unread { background: var(--tc-primary-light); }
.tc-notif-dot-type {
    width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
}
.tc-notif-dot-type.info    { background: var(--tc-primary); }
.tc-notif-dot-type.success { background: var(--tc-green); }
.tc-notif-dot-type.warning { background: var(--tc-orange); }
.tc-notif-dot-type.danger  { background: var(--tc-red); }
.tc-notif-item-title { font-size: 12.5px; font-weight: 600; color: var(--tc-text); }
.tc-notif-item-meta  { font-size: 11px; color: var(--tc-text-soft); margin-top: 2px; }
.tc-notif-empty { text-align: center; padding: 24px 16px; }
.tc-notif-empty svg { opacity: .2; margin: 0 auto 8px; display: block; }
.tc-notif-empty p { font-size: 13px; color: var(--tc-text-soft); }

/* ── KPI Cards ── */
.tc-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.tc-kpi {
    background: #fff;
    border-radius: var(--tc-radius);
    padding: 14px 16px 12px;
    box-shadow: var(--tc-shadow);
    position: relative;
    overflow: hidden;
    min-height: 110px;
    transition: transform .2s, box-shadow .2s;
}
.tc-kpi:hover { transform: translateY(-2px); box-shadow: var(--tc-shadow-md); }
.tc-kpi-title {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--tc-text-soft);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}
.tc-kpi-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}
.tc-kpi-label { font-size: 11px; color: var(--tc-text-soft); }
.tc-kpi-sub {
    position: absolute;
    bottom: 12px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}
.tc-kpi-sub-num {
    font-size: 16px;
    font-weight: 800;
    color: var(--tc-text-soft);
}
.tc-kpi-sub-lbl {
    font-size: 9px;
    font-weight: 600;
    color: var(--tc-text-soft);
    opacity: .65;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.tc-kpi-blob {
    position: absolute;
    bottom: -4px; right: -4px;
    width: 68px; height: 44px;
    opacity: .12;
    border-radius: 50%;
}
.tc-kpi-icon {
    position: absolute;
    top: 14px; right: 14px;
    opacity: .12;
}
.tc-kpi.blue   .tc-kpi-value { color: var(--tc-primary); }
.tc-kpi.green  .tc-kpi-value { color: var(--tc-green); }
.tc-kpi.orange .tc-kpi-value { color: var(--tc-orange); }
.tc-kpi.red    .tc-kpi-value { color: var(--tc-red); }
.tc-kpi.purple .tc-kpi-value { color: var(--tc-purple); }
.tc-kpi.cyan   .tc-kpi-value { color: var(--tc-cyan); }
.tc-kpi.blue   .tc-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--tc-primary) 0%, transparent 70%); }
.tc-kpi.green  .tc-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--tc-green) 0%, transparent 70%); }
.tc-kpi.orange .tc-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--tc-orange) 0%, transparent 70%); }
.tc-kpi.red    .tc-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--tc-red) 0%, transparent 70%); }
.tc-kpi.purple .tc-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--tc-purple) 0%, transparent 70%); }
.tc-kpi.cyan   .tc-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--tc-cyan) 0%, transparent 70%); }
.tc-kpi.blue   .tc-kpi-icon  { color: var(--tc-primary); }
.tc-kpi.green  .tc-kpi-icon  { color: var(--tc-green); }
.tc-kpi.orange .tc-kpi-icon  { color: var(--tc-orange); }
.tc-kpi.red    .tc-kpi-icon  { color: var(--tc-red); }
.tc-kpi.purple .tc-kpi-icon  { color: var(--tc-purple); }
.tc-kpi.cyan   .tc-kpi-icon  { color: var(--tc-cyan); }

/* ── Grilles ── */
.tc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.tc-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }

/* ── Cards ── */
.tc-card {
    background: #fff;
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow);
    overflow: hidden;
}
.tc-card-head {
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--tc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tc-card-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: var(--tc-text) !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tc-card-body { padding: 16px 18px; }
.tc-card-body.tc-p0 { padding: 0; }
.tc-card-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--tc-border);
    text-align: center;
}
.tc-card-foot a {
    font-size: 13px;
    color: var(--tc-primary);
    text-decoration: none;
    font-weight: 500;
}

/* ── Boutons ── */
.tc-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    border-radius: var(--tc-radius-sm) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    border: none !important;
    text-decoration: none !important;
    transition: all .2s !important;
    white-space: nowrap !important;
    font-family: var(--tc-font) !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
.tc-btn-primary   { background: var(--tc-primary) !important; color: #fff !important; }
.tc-btn-primary:hover { background: var(--tc-primary-dark) !important; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.28) !important; }
.tc-btn-secondary { background: #fff !important; color: var(--tc-text) !important; border: 1.5px solid var(--tc-border) !important; }
.tc-btn-secondary:hover { border-color: var(--tc-primary) !important; color: var(--tc-primary) !important; }
.tc-btn-success   { background: var(--tc-green) !important; color: #fff !important; }
.tc-btn-success:hover { background: #15803d !important; }
.tc-btn-danger    { background: var(--tc-red) !important; color: #fff !important; }
.tc-btn-danger:hover  { background: #b91c1c !important; }
.tc-btn-sm { padding: 4px 10px !important; font-size: 12px !important; }

/* ── Badges ── */
.tc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.tc-badge.blue   { background: var(--tc-primary-light); color: var(--tc-primary); }
.tc-badge.green  { background: var(--tc-green-light); color: var(--tc-green); }
.tc-badge.orange { background: var(--tc-orange-light); color: var(--tc-orange); }
.tc-badge.red    { background: var(--tc-red-light); color: var(--tc-red); }
.tc-badge.purple { background: var(--tc-purple-light); color: var(--tc-purple); }
.tc-badge.cyan   { background: var(--tc-cyan-light); color: var(--tc-cyan); }

/* ── Notices ── */
.tc-notice {
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}
.tc-notice.success { background: var(--tc-green-light); color: #166534; border-left: 3px solid var(--tc-green); }
.tc-notice.danger  { background: var(--tc-red-light); color: #991b1b; border-left: 3px solid var(--tc-red); }
.tc-notice.info    { background: var(--tc-primary-light); color: #1e40af; border-left: 3px solid var(--tc-primary); }
.tc-notice.warning { background: var(--tc-orange-light); color: #92400e; border-left: 3px solid var(--tc-orange); }

/* ── Filtres ── */
.tc-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 13px 18px;
    background: #fff;
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow);
    margin-bottom: 16px;
}
.tc-search { position: relative; }
.tc-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--tc-text-soft);
    pointer-events: none;
}
.tc-input, .tc-select, .tc-textarea {
    padding: 8px 12px;
    border: 1.5px solid var(--tc-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--tc-text);
    background: #fff;
    transition: border .2s, box-shadow .2s;
    outline: none;
    width: 100%;
    font-family: var(--tc-font);
}
.tc-input:focus, .tc-select:focus, .tc-textarea:focus {
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ── Tableau ── */
.tc-table-wrap { overflow-x: auto; }
.tc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tc-table th {
    background: var(--tc-bg);
    color: var(--tc-text-soft);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--tc-border);
}
.tc-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--tc-border);
    vertical-align: middle;
}
.tc-table tr:last-child td { border-bottom: none; }
.tc-table tr:hover td { background: #f8fafc; }
.tc-td-actions { display: flex; gap: 4px; }

/* ── Liste de tâches (dashboard) ── */
.tc-task-list { width: 100%; }
.tc-task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--tc-border);
    transition: background .15s;
}
.tc-task-item:last-child { border-bottom: none; }
.tc-task-item:hover { background: var(--tc-bg); }
.tc-task-item.tc-task-today {
    background: var(--tc-orange-light);
    border-left: 3px solid var(--tc-orange);
    padding-left: 15px;
}
.tc-task-item.tc-task-today:hover { background: #fff3cd; }
.tc-task-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--tc-border);
    background: none;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s;
    color: #fff;
}
.tc-task-check:hover { border-color: var(--tc-green); }
.tc-task-check.checked { background: var(--tc-green); border-color: var(--tc-green); }
.tc-task-item-body { flex: 1; min-width: 0; }
.tc-task-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-task-item-title.done {
    text-decoration: line-through;
    color: var(--tc-text-soft);
    font-weight: 400;
}
.tc-task-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}
.tc-task-due {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--tc-text-soft);
}
.tc-task-priority { flex-shrink: 0; }
.tc-task-title-cell {
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
}
.tc-task-title-cell.done { text-decoration: line-through; color: var(--tc-text-soft); }
.tc-task-link { color: inherit; text-decoration: none; }
.tc-task-link:hover { color: var(--tc-primary); text-decoration: underline; }
.tc-task-desc-cell { font-size: 11.5px; color: var(--tc-text-soft); margin-top: 2px; }
.tc-due-date { font-size: 12px; color: var(--tc-text-soft); }
.tc-due-date.overdue { color: var(--tc-red); font-weight: 600; }
.tc-no-date { color: var(--tc-text-soft); opacity: .4; }

/* ── Plugins connectés (barre de progression) ── */
.tc-plugin-list { display: flex; flex-direction: column; gap: 10px; }
.tc-plugin-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tc-plugin-color-bar {
    width: 4px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
}
.tc-plugin-color-bar.blue   { background: var(--tc-primary); }
.tc-plugin-color-bar.green  { background: var(--tc-green); }
.tc-plugin-color-bar.orange { background: var(--tc-orange); }
.tc-plugin-color-bar.purple { background: var(--tc-purple); }
.tc-plugin-color-bar.cyan   { background: var(--tc-cyan); }
.tc-plugin-info { flex-shrink: 0; width: 120px; }
.tc-plugin-name { font-size: 12.5px; font-weight: 600; color: var(--tc-text); display: block; }
.tc-plugin-count { font-size: 11px; color: var(--tc-text-soft); }
.tc-plugin-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--tc-bg);
    border-radius: 6px;
    overflow: hidden;
}
.tc-plugin-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width .4s ease;
}
.tc-plugin-bar-fill.blue   { background: var(--tc-primary); }
.tc-plugin-bar-fill.green  { background: var(--tc-green); }
.tc-plugin-bar-fill.orange { background: var(--tc-orange); }
.tc-plugin-bar-fill.purple { background: var(--tc-purple); }
.tc-plugin-bar-fill.cyan   { background: var(--tc-cyan); }

/* ── Notifications liste (dans card) ── */
.tc-notif-list { width: 100%; }
.tc-notif-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--tc-border);
}
.tc-notif-list-item:last-child { border-bottom: none; }
.tc-notif-list-item.unread { background: var(--tc-primary-light); }
.tc-notif-type-dot {
    width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
}
.tc-notif-type-dot.info    { background: var(--tc-primary); }
.tc-notif-type-dot.success { background: var(--tc-green); }
.tc-notif-type-dot.warning { background: var(--tc-orange); }
.tc-notif-type-dot.danger  { background: var(--tc-red); }
.tc-notif-list-title { font-size: 12.5px; font-weight: 600; color: var(--tc-text); }
.tc-notif-list-meta  { font-size: 11px; color: var(--tc-text-soft); margin-top: 2px; }

/* ── Page notifications complète ── */
.tc-notif-full-list { width: 100%; }
.tc-notif-full-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--tc-border);
    transition: background .15s;
}
.tc-notif-full-item:last-child { border-bottom: none; }
.tc-notif-full-item:hover { background: var(--tc-bg); }
.tc-notif-full-item.unread { background: var(--tc-primary-light); }
.tc-notif-full-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tc-notif-full-icon.info    { background: var(--tc-primary-light); color: var(--tc-primary); }
.tc-notif-full-icon.success { background: var(--tc-green-light); color: var(--tc-green); }
.tc-notif-full-icon.warning { background: var(--tc-orange-light); color: var(--tc-orange); }
.tc-notif-full-icon.danger  { background: var(--tc-red-light); color: var(--tc-red); }
.tc-notif-full-body { flex: 1; min-width: 0; }
.tc-notif-full-title { font-size: 13.5px; font-weight: 600; color: var(--tc-text); }
.tc-notif-full-msg   { font-size: 12.5px; color: var(--tc-text-soft); margin-top: 3px; }
.tc-notif-full-meta  {
    display: flex; align-items: center; gap: 8px;
    margin-top: 6px; font-size: 11.5px; color: var(--tc-text-soft);
}
.tc-notif-mark-read, .tc-notif-link-btn {
    background: none; border: none; cursor: pointer;
    color: var(--tc-text-soft); padding: 4px; border-radius: 6px;
    transition: all .15s; flex-shrink: 0;
}
.tc-notif-mark-read:hover { background: var(--tc-green-light); color: var(--tc-green); }
.tc-notif-link-btn:hover  { background: var(--tc-primary-light); color: var(--tc-primary); }

/* ── Fournisseurs IA (Paramètres > Connecteurs > IA) ── */
.tc-ia-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tc-border);
    flex-wrap: wrap;
}
.tc-ia-row:last-of-type { border-bottom: none; }
.tc-ia-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tc-ia-info {
    flex: 0 0 180px;
    min-width: 120px;
}
.tc-ia-info strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--tc-text);
}
.tc-ia-mask {
    font-size: 11.5px;
    color: var(--tc-text-soft);
    font-family: 'SFMono-Regular', Consolas, monospace;
    letter-spacing: .04em;
}
.tc-ia-input { flex: 1; min-width: 180px; }

.tc-ia-btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    color: var(--tc-red);
    background: var(--tc-red-light);
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    transition: all .18s;
    flex-shrink: 0;
    font-family: var(--tc-font);
}
.tc-ia-btn-delete:hover { background: var(--tc-red); color: #fff; border-color: var(--tc-red); }

.tc-ia-custom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--tc-border);
    flex-wrap: wrap;
}
.tc-ia-custom-row:last-of-type { border-bottom: none; }
.tc-ia-custom-name {
    font-size: 13px; font-weight: 700; color: var(--tc-text);
    flex: 0 0 140px;
}
.tc-ia-custom-mask {
    font-size: 11.5px; color: var(--tc-text-soft);
    font-family: 'SFMono-Regular', Consolas, monospace;
    flex: 0 0 120px;
}

.tc-ia-add-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.tc-ia-add-row .tc-input { flex: 1; min-width: 140px; }

/* ── Card accès plugins ── */
.tc-ia-plugins-list { display: flex; flex-direction: column; gap: 0; }
.tc-ia-plugin-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tc-border);
}
.tc-ia-plugin-row:last-child { border-bottom: none; }
.tc-ia-plugin-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--tc-text); }

/* Toggle switch */
.tc-ia-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}
.tc-ia-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.tc-ia-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 22px;
    transition: background .2s;
}
.tc-ia-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tc-ia-toggle-input:checked + .tc-ia-toggle-slider { background: var(--tc-primary); }
.tc-ia-toggle-input:checked + .tc-ia-toggle-slider::before { transform: translateX(18px); }
.tc-ia-toggle-input:disabled + .tc-ia-toggle-slider { opacity: .5; cursor: not-allowed; }

/* ── Onglets Paramètres niveau 1 (style MT : pilule dans bac) ── */
.tc-params-tabs {
    display: flex;
    gap: 2px;
    background: #dde3ed;
    padding: 4px;
    border-radius: var(--tc-radius-sm);
    width: fit-content;
    margin-bottom: 20px;
}
.tc-params-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tc-text-soft);
    background: none;
    border: none;
    cursor: pointer;
    transition: all .2s;
    font-family: var(--tc-font);
}
.tc-params-tab:hover  { background: rgba(0,0,0,.05); color: var(--tc-text); }
.tc-params-tab.active { background: #fff; color: var(--tc-primary); font-weight: 600; box-shadow: 0 2px 12px rgba(0,0,0,.07); }

.tc-params-panel { display: none; }
.tc-params-panel.active { display: block; }

/* Grille paramètres Planning — 2 colonnes côte à côte */
.tc-planning-settings-grid { display: flex; gap: 16px; align-items: flex-start; }
.tc-planning-settings-grid > .tc-card { flex: 1; min-width: 0; }
@media (max-width: 700px) { .tc-planning-settings-grid { flex-direction: column; } }

/* Fréquence sync Google Calendar */
.tc-sync-freq-options { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.tc-sync-freq-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background .12s;
}
.tc-sync-freq-option:hover { background: var(--tc-bg-soft, #f5f5f5); }
.tc-sync-freq-option input[type="radio"] { accent-color: var(--tc-primary); cursor: pointer; }
.tc-sync-freq-option input[type="radio"]:checked + span { font-weight: 600; color: var(--tc-primary); }
.tc-sync-freq-status { font-size: 11px; min-height: 14px; margin-bottom: 6px; line-height: 1.4; }
.tc-sync-freq-status:empty { display: none; }
.tc-sync-freq-status.success { color: var(--tc-green, #16a34a); }
.tc-sync-freq-status.error   { color: var(--tc-red,   #dc2626); }
.tc-sync-freq-info { font-size: 11px; color: var(--tc-text-soft, #888); display: flex; align-items: center; gap: 4px; margin-top: 2px; }

/* ── Sous-onglets Paramètres niveau 2 (même style, taille réduite) ── */
.tc-params-subtabs {
    display: flex;
    gap: 2px;
    background: #dde3ed;
    padding: 3px;
    border-radius: 6px;
    width: fit-content;
    margin-bottom: 18px;
}
.tc-params-subtab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tc-text-soft);
    background: none;
    border: none;
    cursor: pointer;
    transition: all .2s;
    font-family: var(--tc-font);
}
.tc-params-subtab:hover  { background: rgba(0,0,0,.05); color: var(--tc-text); }
.tc-params-subtab.active { background: #fff; color: var(--tc-primary); font-weight: 600; box-shadow: 0 1px 6px rgba(0,0,0,.08); }

.tc-params-subpanel { display: none; }
.tc-params-subpanel.active { display: block; }

/* ── État vide ── */
.tc-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--tc-text-soft);
}
.tc-empty svg { opacity: .2; margin: 0 auto 12px; display: block; }
.tc-empty p   { font-size: 13.5px; margin-bottom: 14px; line-height: 1.6; }

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

/* ── Responsive ── */
@media (max-width: 1100px) {
    .tc-kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .tc-grid-2, .tc-grid-3 { grid-template-columns: 1fr; }
    .tc-kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .tc-app { flex-direction: column; border-radius: 12px; }
    .tc-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--tc-border);
        display: none;
    }
    .tc-sidebar.open { display: flex; }
    .tc-menu-toggle { display: flex; }
    .tc-content-body { padding: 14px 14px 28px; }
    .tc-kpi-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .tc-kpi-row { grid-template-columns: 1fr; }
    .tc-filters { flex-direction: column; align-items: stretch; }
    .tc-filters .tc-input, .tc-filters .tc-select { width: 100% !important; }
}

/* ════════════════════════════════════════════════════════════════
   PLANNING — Calendrier centralisé
   ════════════════════════════════════════════════════════════════ */

/* Suppression padding corps quand onglet planning */
.tc-content-body--planning {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

/* Recherche planning dans le header */
.tc-planning-header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--tc-bg);
    border: 1.5px solid var(--tc-border);
    border-radius: 10px;
    padding: 6px 12px;
    margin-left: 8px;
    transition: border-color .18s;
}
.tc-planning-header-search:focus-within { border-color: var(--tc-primary); }
.tc-planning-header-search svg { color: var(--tc-text-soft); flex-shrink: 0; }
.tc-planning-header-search input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--tc-text);
    outline: none;
    width: 190px;
    font-family: var(--tc-font);
}
.tc-planning-header-search input::placeholder { color: var(--tc-text-soft); }

/* ── Wrapper principal ── */
.tc-planning-body-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Barre d'outils ── */
.tc-planning-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--tc-white);
    border-bottom: 1px solid var(--tc-border);
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Groupe boutons vue */
.tc-pv-group {
    display: flex;
    background: var(--tc-bg);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
}
.tc-pv-btn {
    background: none;
    border: none;
    border-radius: 8px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tc-text-soft);
    cursor: pointer;
    transition: all .15s;
    font-family: var(--tc-font);
    line-height: 1;
}
.tc-pv-btn:hover { color: var(--tc-text); background: rgba(0,0,0,.04); }
.tc-pv-btn.active {
    background: var(--tc-white);
    color: var(--tc-primary);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* Navigation date */
.tc-planning-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tc-planning-toolbar-spacer { flex: 1; }
.tc-cal-nav-btn {
    background: none;
    border: 1.5px solid var(--tc-border);
    border-radius: 8px;
    padding: 5px 8px;
    cursor: pointer;
    color: var(--tc-text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    line-height: 1;
}
.tc-cal-nav-btn:hover { border-color: var(--tc-primary); color: var(--tc-primary); }
.tc-cal-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tc-text);
    padding: 0 6px;
    white-space: nowrap;
    min-width: 180px;
    text-align: center;
}
/* Bouton Créer une tâche dans la toolbar */
.tc-planning-create-main {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    margin-left: 6px;
}

/* Liens sidebar droite */
.tc-planning-clear-all,
.tc-planning-voir-tout {
    font-size: 11px;
    font-weight: 500;
    color: var(--tc-primary);
    text-decoration: none;
}
.tc-planning-clear-all:hover,
.tc-planning-voir-tout:hover { text-decoration: underline; }

.tc-planning-panel-title-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Filtres : selects empilés */
.tc-planning-filter-selects {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tc-planning-filter-select {
    width: 100%;
    font-size: 12px;
}

/* Export v2 */
.tc-planning-export-btn-v2 {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: var(--tc-bg);
    border: 1px solid var(--tc-border);
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--tc-text);
    cursor: pointer;
    opacity: 1;
    font-family: var(--tc-font);
    margin-bottom: 6px;
    text-align: left;
    transition: background .15s, border-color .15s;
}
.tc-planning-export-btn-v2:not(:disabled):hover { background: var(--tc-bg-soft, #f5f5f5); }
.tc-planning-export-btn-v2:disabled {
    cursor: not-allowed;
    opacity: .55;
}
.tc-planning-export-btn-v2:last-child { margin-bottom: 0; }

/* Bouton Google Calendar — état chargement */
.tc-gcal-sync-btn.loading { opacity: .7; cursor: wait; }
.tc-gcal-sync-btn.loading .tc-gcal-sync-label::after { content: '…'; }

/* Sélecteur de connexion inline */
.tc-gcal-conn-panel {
    margin: 4px 0 6px;
    padding: 8px;
    background: var(--tc-bg-soft, #f8f8f8);
    border: 1px solid var(--tc-border);
    border-radius: 8px;
}
.tc-gcal-conn-select {
    width: 100%;
    font-size: 11.5px;
    padding: 5px 8px;
    border: 1px solid var(--tc-border);
    border-radius: 6px;
    margin-bottom: 5px;
    background: var(--tc-bg);
    color: var(--tc-text);
    font-family: var(--tc-font);
}
.tc-gcal-conn-confirm {
    width: 100%;
    justify-content: center;
    font-size: 11.5px;
}

/* Feedback de synchronisation */
.tc-gcal-sync-status {
    font-size: 10.5px;
    color: var(--tc-text-soft, #888);
    margin-bottom: 6px;
    min-height: 0;
    line-height: 1.4;
}
.tc-gcal-sync-status:empty { display: none; }
.tc-gcal-sync-status.success { color: var(--tc-green, #16a34a); }
.tc-gcal-sync-status.error   { color: var(--tc-red,   #dc2626); }
.tc-gcal-sync-status a { color: inherit; text-decoration: underline; }

/* Note sync unidirectionnelle */
.tc-gcal-sync-hint {
    font-size: 10px;
    color: var(--tc-text-soft, #aaa);
    margin: 4px 0 0;
    line-height: 1.4;
}
.tc-gcal-sync-hint code {
    font-size: 9.5px;
    background: var(--tc-bg-soft, #f0f0f0);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Tâches en retard v2 */
.tc-overdue-body { flex: 1; min-width: 0; }
.tc-overdue-meta { font-size: 10px; color: var(--tc-text-soft); margin-top: 1px; }
.tc-overdue-badge {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--tc-red);
    background: var(--tc-red-light);
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Légende — label "Types de tâches" */
.tc-cal-legend-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--tc-text-soft);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding-right: 8px;
    border-right: 1px solid var(--tc-border);
    margin-right: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.tc-cal-legend-item svg { flex-shrink: 0; color: var(--tc-text-soft); }

/* ── Mise en page : aside + centre ── */
.tc-planning-layout {
    display: flex;
    flex: 1;
    align-items: flex-start;
    min-height: 620px;
}

/* Sidebar droite */
.tc-planning-aside {
    width: 260px;
    min-width: 260px;
    background: var(--tc-green-light);
    border-left: 1px solid var(--tc-border);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-self: stretch;
    order: 2;
}

/* Bouton créer */
.tc-planning-create-btn {
    width: 100%;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

/* Panels sidebar */
.tc-planning-panel {
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    padding: 10px 11px;
    margin-bottom: 10px;
    background: var(--tc-white);
}
.tc-planning-panel--nocap { padding: 10px 8px; }
.tc-planning-panel-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--tc-text-soft);
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tc-planning-empty-msg { font-size: 11.5px; color: var(--tc-text-soft); margin: 0; }

/* Zone centrale */
.tc-planning-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-width: 0;
    background: var(--tc-bg);
}

/* Calendrier */
#tc-calendar {
    flex: 1;
    overflow: auto;
    background: var(--tc-white);
    min-height: 600px;
}

/* ── Mini Calendrier ── */
.tc-minical { font-size: 12px; user-select: none; }
.tc-minical-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}
.tc-minical-title { font-size: 12px; font-weight: 700; color: var(--tc-text); }
.tc-minical-nav {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tc-text-soft);
    font-size: 16px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 5px;
    transition: color .15s;
    font-family: var(--tc-font);
}
.tc-minical-nav:hover { color: var(--tc-primary); background: var(--tc-bg); }
.tc-minical-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 3px;
}
.tc-minical-days span {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--tc-text-soft);
    text-transform: uppercase;
    padding: 2px 0;
}
.tc-minical-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}
.tc-minical-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--tc-text);
    border-radius: 50%;
    cursor: pointer;
    transition: all .12s;
    position: relative;
}
.tc-minical-day:hover:not(.is-today) { background: var(--tc-bg); }
.tc-minical-day.is-today {
    background: var(--tc-primary);
    color: #fff;
    font-weight: 700;
}
.tc-minical-day.has-task::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px; height: 3px;
    background: var(--tc-primary);
    border-radius: 50%;
}
.tc-minical-day.is-today::after { background: rgba(255,255,255,.75); }
.tc-minical-empty { aspect-ratio: 1; }

/* ── Filtres ── */
.tc-cal-filter-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--tc-text);
    cursor: pointer;
    padding: 3px 0;
}
.tc-cal-filter-item input[type="checkbox"] { width: 13px; height: 13px; cursor: pointer; margin: 0; flex-shrink: 0; }
.tc-cal-filter-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tc-cal-filter-dot--blue   { background: var(--tc-primary); }
.tc-cal-filter-dot--green  { background: var(--tc-green); }
.tc-cal-filter-dot--orange { background: var(--tc-orange); }
.tc-cal-filter-dot--purple { background: var(--tc-purple); }
.tc-cal-filter-dot--red    { background: var(--tc-red); }
.tc-cal-filter-dot--cyan   { background: var(--tc-cyan); }

/* ── Tâches en retard (sidebar) ── */
.tc-overdue-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 5px 0;
    border-bottom: 1px solid var(--tc-border);
}
.tc-overdue-item:last-child { border-bottom: none; }
.tc-overdue-item[data-source="thrivecentral"] { cursor: pointer; border-radius: 5px; padding: 5px 4px; margin: 0 -4px; }
.tc-overdue-item[data-source="thrivecentral"]:hover { background: var(--tc-primary-light); }
.tc-overdue-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.tc-overdue-dot--blue   { background: var(--tc-primary); }
.tc-overdue-dot--green  { background: var(--tc-green); }
.tc-overdue-dot--orange { background: var(--tc-orange); }
.tc-overdue-dot--purple { background: var(--tc-purple); }
.tc-overdue-dot--red    { background: var(--tc-red); }
.tc-overdue-title { font-size: 11px; font-weight: 500; color: var(--tc-text); line-height: 1.4; }
.tc-overdue-date  { font-size: 10px; color: var(--tc-red); margin-top: 1px; }
.tc-planning-more { font-size: 10.5px; color: var(--tc-text-soft); margin: 5px 0 0; }

/* ── Export ── */
.tc-planning-export-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 7px;
    font-size: 11.5px;
    opacity: .65;
}
.tc-planning-export-btn + .tc-planning-export-btn { margin-top: 6px; }
.tc-planning-export-btn:disabled { cursor: not-allowed; }

/* ════════════════════════════════════
   GRILLE — Semaine et Jour
   ════════════════════════════════════ */
.tc-cal-week-grid,
.tc-cal-day-view {
    display: flex;
    flex-direction: column;
    min-width: 560px;
}

/* En-tête colonnes jours */
.tc-cal-week-head,
.tc-cal-day-head {
    display: flex;
    border-bottom: 1px solid var(--tc-border);
    background: var(--tc-white);
    position: sticky;
    top: 0;
    z-index: 5;
}
.tc-cal-gutter {
    width: 54px;
    min-width: 54px;
    flex-shrink: 0;
    border-right: 1px solid var(--tc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 9.5px;
    color: var(--tc-text-soft);
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tc-cal-col-head {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    border-right: 1px solid var(--tc-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.tc-cal-col-head:last-child { border-right: none; }
.tc-cal-col-head.is-today { background: var(--tc-primary-light); }
.tc-cwh-day {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tc-text-soft);
    letter-spacing: .06em;
}
.tc-cwh-num {
    font-size: 17px;
    font-weight: 700;
    color: var(--tc-text);
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.tc-cwh-num.is-today { background: var(--tc-primary); color: #fff; }

/* Ligne "Tout le jour" */
.tc-cal-allday {
    display: flex;
    border-bottom: 2px solid var(--tc-border);
    min-height: 28px;
    background: var(--tc-white);
}
.tc-cal-allday-cell {
    flex: 1;
    border-right: 1px solid var(--tc-border);
    padding: 3px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 28px;
}
.tc-cal-allday-cell:last-child { border-right: none; }

/* Corps heure par heure */
.tc-cal-body { display: flex; }
.tc-cal-time-col {
    width: 54px;
    min-width: 54px;
    flex-shrink: 0;
    border-right: 1px solid var(--tc-border);
}
.tc-cal-hour {
    height: 56px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 4px 6px 0 0;
    border-bottom: 1px solid rgba(226,232,240,.6);
}
.tc-cal-hour span { font-size: 9.5px; color: var(--tc-text-soft); font-weight: 600; line-height: 1; }
.tc-cal-day-col {
    flex: 1;
    position: relative;
    border-right: 1px solid var(--tc-border);
    background: var(--tc-white);
}
.tc-cal-day-col:last-child { border-right: none; }
.tc-cal-day-col.is-today { background: rgba(37,99,235,.025); }
.tc-cal-slot {
    height: 56px;
    border-bottom: 1px solid rgba(226,232,240,.6);
    transition: background .1s;
}
.tc-cal-slot:hover { background: var(--tc-bg); }

/* Ligne heure actuelle */
.tc-cal-now-line {
    position: absolute;
    left: -1px; right: 0;
    height: 2px;
    background: var(--tc-red);
    z-index: 3;
    pointer-events: none;
}
.tc-cal-now-line::before {
    content: '';
    position: absolute;
    left: 0; top: -4px;
    width: 8px; height: 8px;
    background: var(--tc-red);
    border-radius: 50%;
}

/* ════════════════════════════════════
   GRILLE — Mois
   ════════════════════════════════════ */
.tc-cal-month-grid { display: flex; flex-direction: column; min-width: 500px; }
.tc-cal-month-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 2px solid var(--tc-border);
    background: var(--tc-white);
    position: sticky;
    top: 0;
    z-index: 5;
}
.tc-cal-month-hcell {
    text-align: center;
    padding: 8px 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tc-text-soft);
    border-right: 1px solid var(--tc-border);
}
.tc-cal-month-hcell:last-child { border-right: none; }
.tc-cal-month-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.tc-cal-month-cell {
    min-height: 96px;
    border-right: 1px solid var(--tc-border);
    border-bottom: 1px solid var(--tc-border);
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    background: var(--tc-white);
}
.tc-cal-month-cell:nth-child(7n) { border-right: none; }
.tc-cal-month-cell.is-today { background: var(--tc-primary-light); }
.tc-cal-month-cell--empty {
    min-height: 96px;
    border-right: 1px solid var(--tc-border);
    border-bottom: 1px solid var(--tc-border);
    background: var(--tc-bg);
    opacity: .6;
}
.tc-cal-month-num {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tc-text-soft);
    width: 22px; height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 2px;
}
.tc-cal-month-num.is-today { background: var(--tc-primary); color: #fff; font-weight: 700; }
.tc-cal-more {
    font-size: 10px;
    color: var(--tc-text-soft);
    padding: 1px 3px;
    cursor: pointer;
}
.tc-cal-more:hover { color: var(--tc-primary); }

/* ════════════════════════════════════
   VUE — Liste
   ════════════════════════════════════ */
.tc-cal-list { padding: 20px; max-width: 860px; }
.tc-cal-list-group { margin-bottom: 22px; }
.tc-cal-list-date {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--tc-text-soft);
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 6px 0 8px;
    border-bottom: 2px solid var(--tc-border);
    margin-bottom: 8px;
}
.tc-cal-list-date.is-today  { color: var(--tc-primary); border-color: var(--tc-primary); }
.tc-cal-list-date.is-past   { color: var(--tc-red); }
.tc-cal-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--tc-white);
    border: 1px solid var(--tc-border);
    margin-bottom: 6px;
    transition: box-shadow .15s;
}
.tc-cal-list-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.tc-cal-list-item[data-source="thrivecentral"] { cursor: pointer; }
.tc-cal-list-item[data-source="thrivecentral"]:hover { box-shadow: 0 2px 10px rgba(124,58,237,.18); }
.tc-cal-list-item-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.tc-cal-list-item--blue .tc-cal-list-item-dot   { background: var(--tc-primary); }
.tc-cal-list-item--green .tc-cal-list-item-dot  { background: var(--tc-green); }
.tc-cal-list-item--orange .tc-cal-list-item-dot { background: var(--tc-orange); }
.tc-cal-list-item--purple .tc-cal-list-item-dot { background: var(--tc-purple); }
.tc-cal-list-item--red .tc-cal-list-item-dot    { background: var(--tc-red); }
.tc-cal-list-item--cyan .tc-cal-list-item-dot   { background: var(--tc-cyan); }
.tc-cal-list-title { font-size: 13px; font-weight: 600; color: var(--tc-text); }
.tc-cal-list-meta  { margin-top: 4px; display: flex; gap: 6px; align-items: center; }

/* ════════════════════════════════════
   ÉVÉNEMENTS
   ════════════════════════════════════ */
.tc-cal-event {
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: opacity .15s;
    margin-bottom: 2px;
    line-height: 1.4;
}
.tc-cal-event:hover { opacity: .8; }
.tc-cal-event--blue   { background: var(--tc-primary-light); color: var(--tc-primary);  border-left: 3px solid var(--tc-primary); }
.tc-cal-event--green  { background: var(--tc-green-light);   color: var(--tc-green);    border-left: 3px solid var(--tc-green); }
.tc-cal-event--orange { background: var(--tc-orange-light);  color: var(--tc-orange);   border-left: 3px solid var(--tc-orange); }
.tc-cal-event--purple { background: var(--tc-purple-light);  color: var(--tc-purple);   border-left: 3px solid var(--tc-purple); }
.tc-cal-event--red    { background: var(--tc-red-light);     color: var(--tc-red);      border-left: 3px solid var(--tc-red); }
.tc-cal-event--cyan   { background: var(--tc-cyan-light);    color: var(--tc-cyan);     border-left: 3px solid var(--tc-cyan); }
.tc-cal-event--gcal   { background: #fcbf49;                 color: #5c3a00;            border-left: 3px solid #e6a800; }
.tc-cal-event-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Blocs tâches positionnés dans la grille heure ── */
.tc-cal-ev-block {
    position: absolute;
    left: 3px; right: 3px;
    height: 50px;
    border-radius: 5px;
    padding: 5px 7px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: opacity .15s, box-shadow .15s;
    z-index: 2;
}
.tc-cal-ev-block:hover { opacity: .85; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.tc-cal-ev-block[data-source="thrivecentral"] { cursor: pointer; }
.tc-cal-ev-block[data-source="thrivecentral"]:hover { opacity: 1; box-shadow: 0 3px 10px rgba(124,58,237,.25); }
.tc-cal-ev-block--blue   { background: var(--tc-primary-light); border-left: 3px solid var(--tc-primary); color: var(--tc-primary); }
.tc-cal-ev-block--green  { background: var(--tc-green-light);   border-left: 3px solid var(--tc-green);   color: var(--tc-green); }
.tc-cal-ev-block--orange { background: var(--tc-orange-light);  border-left: 3px solid var(--tc-orange);  color: var(--tc-orange); }
.tc-cal-ev-block--purple { background: var(--tc-purple-light);  border-left: 3px solid var(--tc-purple);  color: var(--tc-purple); }
.tc-cal-ev-block--red    { background: var(--tc-red-light);     border-left: 3px solid var(--tc-red);     color: var(--tc-red); }
.tc-cal-ev-block--cyan   { background: var(--tc-cyan-light);    border-left: 3px solid var(--tc-cyan);    color: var(--tc-cyan); }
.tc-cal-ev-block-title {
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.tc-cal-ev-block-src {
    font-size: 10px;
    opacity: .75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-cal-ev-more {
    position: absolute;
    left: 3px; right: 3px;
    height: 22px;
    background: rgba(0,0,0,.06);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 7px;
    font-size: 10.5px;
    color: var(--tc-text-soft);
    font-weight: 600;
    z-index: 2;
    cursor: default;
}
.tc-cal-ev-more--slot {
    cursor: pointer;
    background: rgba(var(--tc-primary-rgb, 99,102,241),.12);
    color: var(--tc-primary);
}
.tc-cal-ev-more--slot:hover { background: rgba(var(--tc-primary-rgb, 99,102,241),.22); }
.tc-cal-more--slot { cursor: pointer; color: var(--tc-primary); font-weight: 600; }
.tc-cal-more--slot:hover { text-decoration: underline; }

/* Popup créneaux partagés */
.tc-slot-popup {
    position: absolute;
    z-index: 9999;
    width: 240px;
    background: var(--tc-surface, #fff);
    border: 1px solid var(--tc-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    overflow: hidden;
}
.tc-slot-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--tc-border, #e5e7eb);
}
.tc-slot-popup-title-head {
    font-size: 12px;
    font-weight: 700;
    color: var(--tc-text, #111);
}
.tc-slot-popup-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--tc-text-soft);
    padding: 0 2px;
}
.tc-slot-popup-close:hover { color: var(--tc-text); }
.tc-slot-popup-list { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 5px; }
.tc-slot-popup-item {
    display: flex;
    flex-direction: column;
    padding: 6px 9px;
    border-radius: 6px;
    cursor: pointer;
    min-width: 0;
}
.tc-slot-popup-item[data-id] { cursor: pointer; }
.tc-slot-popup-item[data-id]:hover { filter: brightness(.93); }
.tc-slot-popup-title { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-slot-popup-src   { font-size: 10px; opacity: .75; margin-top: 1px; }
.tc-cwh-count {
    font-size: 10px;
    font-weight: 700;
    background: var(--tc-primary);
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    line-height: 1.5;
}

/* Popup prévisualisation tâche */
.tc-task-preview {
    position: absolute;
    z-index: 9999;
    width: 240px;
    background: var(--tc-surface, #fff);
    border: 1px solid var(--tc-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    overflow: hidden;
}
.tc-tp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    border-radius: 0;
}
.tc-tp-title {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
    flex: 1;
    word-break: break-word;
}
.tc-tp-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: .7;
    padding: 0 2px;
    flex-shrink: 0;
}
.tc-tp-close:hover { opacity: 1; }
.tc-tp-body {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 8px;
    border-top: 1px solid rgba(0,0,0,.06);
}
.tc-tp-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--tc-text-soft);
}
.tc-tp-footer {
    padding: 0 12px 10px;
}

/* ════════════════════════════════════
   LÉGENDE
   ════════════════════════════════════ */
.tc-cal-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 16px;
    background: var(--tc-white);
    border-top: 1px solid var(--tc-border);
    flex-wrap: wrap;
    flex-shrink: 0;
}
.tc-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--tc-text-soft);
}
.tc-cal-legend-item--right { margin-left: auto; }
.tc-cal-legend-dot {
    width: 10px; height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.tc-cal-legend-dot--blue   { background: var(--tc-primary); }
.tc-cal-legend-dot--green  { background: var(--tc-green); }
.tc-cal-legend-dot--orange { background: var(--tc-orange); }
.tc-cal-legend-dot--purple { background: var(--tc-purple); }
.tc-cal-legend-dot--cyan   { background: var(--tc-cyan); }

/* ════════════════════════════════════
   DASHBOARD — PLANNING WIDGET
   ════════════════════════════════════ */
.tc-db-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}
.tc-db-planning-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.tc-db-right-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}
.tc-db-plan-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--tc-border);
    flex-wrap: wrap;
}
.tc-db-plan-tabs {
    display: flex;
    background: var(--tc-bg);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}
.tc-db-plan-tab {
    padding: 5px 13px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tc-text-soft);
    cursor: pointer;
    transition: all .15s;
    font-family: var(--tc-font);
    white-space: nowrap;
}
.tc-db-plan-tab.active {
    background: var(--tc-white);
    color: var(--tc-text);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.tc-db-plan-tab:hover:not(.active) { color: var(--tc-text); }
.tc-db-plan-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}
.tc-db-nav-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--tc-border);
    background: var(--tc-white);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    color: var(--tc-text-soft);
    transition: all .15s;
    font-family: var(--tc-font);
}
.tc-db-nav-btn:hover { border-color: var(--tc-primary); color: var(--tc-primary); }
.tc-db-plan-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
    min-width: 160px;
    text-align: center;
    white-space: nowrap;
}
.tc-db-plan-body {
    max-height: 320px;
    overflow-y: auto;
}
.tc-db-plan-group { /* date group container */ }
.tc-db-plan-date {
    padding: 10px 16px 5px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--tc-text-soft);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--tc-border);
    background: var(--tc-bg);
    position: sticky;
    top: 0;
    z-index: 1;
}
.tc-db-plan-date.is-today { color: var(--tc-primary); }
.tc-db-plan-date.is-past  { color: var(--tc-red); }
.tc-db-today-badge {
    font-size: 10px;
    background: var(--tc-primary);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}
.tc-db-plan-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--tc-border);
    cursor: pointer;
    transition: filter .12s;
}
.tc-db-plan-task:last-child { border-bottom: none; }
.tc-db-plan-task:hover { filter: brightness(.96); }
.tc-db-plan-task--blue   { background: var(--tc-primary-light); border-left-color: var(--tc-primary); }
.tc-db-plan-task--green  { background: var(--tc-green-light);   border-left-color: var(--tc-green); }
.tc-db-plan-task--orange { background: var(--tc-orange-light);  border-left-color: var(--tc-orange); }
.tc-db-plan-task--purple { background: var(--tc-purple-light);  border-left-color: var(--tc-purple); }
.tc-db-plan-task--red    { background: var(--tc-red-light);     border-left-color: var(--tc-red); }
.tc-db-plan-task--cyan   { background: var(--tc-cyan-light);    border-left-color: var(--tc-cyan); }
.tc-db-plan-task-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-db-plan-task--blue   .tc-db-plan-task-icon { background: rgba(37,99,235,.14);  color: var(--tc-primary); }
.tc-db-plan-task--green  .tc-db-plan-task-icon { background: rgba(22,163,74,.14);  color: var(--tc-green); }
.tc-db-plan-task--orange .tc-db-plan-task-icon { background: rgba(217,119,6,.14);  color: var(--tc-orange); }
.tc-db-plan-task--purple .tc-db-plan-task-icon { background: rgba(124,58,237,.14); color: var(--tc-purple); }
.tc-db-plan-task--red    .tc-db-plan-task-icon { background: rgba(220,38,38,.14);  color: var(--tc-red); }
.tc-db-plan-task--cyan   .tc-db-plan-task-icon { background: rgba(0,180,216,.14);  color: var(--tc-cyan); }
.tc-db-plan-task-body { flex: 1; min-width: 0; }
.tc-db-plan-task-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.tc-db-plan-task-meta {
    font-size: 11px;
    color: var(--tc-text-soft);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-db-plan-task-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}
.tc-db-plan-task-due {
    font-size: 11px;
    font-weight: 600;
    color: var(--tc-text-soft);
    white-space: nowrap;
}
.tc-db-plan-task-pri {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.tc-db-plan-task--blue   .tc-db-plan-task-pri { background: rgba(37,99,235,.15);  color: var(--tc-primary); }
.tc-db-plan-task--green  .tc-db-plan-task-pri { background: rgba(22,163,74,.15);  color: var(--tc-green); }
.tc-db-plan-task--orange .tc-db-plan-task-pri { background: rgba(217,119,6,.15);  color: var(--tc-orange); }
.tc-db-plan-task--purple .tc-db-plan-task-pri { background: rgba(124,58,237,.15); color: var(--tc-purple); }
.tc-db-plan-task--red    .tc-db-plan-task-pri { background: rgba(220,38,38,.15);  color: var(--tc-red); }
.tc-db-plan-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--tc-text-soft);
    font-size: 13px;
}

/* ── Responsive Planning ── */
@media (max-width: 900px) {
    .tc-planning-aside { width: 188px; min-width: 188px; }
    .tc-planning-header-search input { width: 140px; }
}

/* ════════════════════════════════════════════════════════════════
   AGENTS HUB — Section "Mes Agents"
   ════════════════════════════════════════════════════════════════ */

/* ── Sidebar : indicateur de statut agent ── */
.tc-nav-agent-status {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
    background: var(--tc-border);
}
.tc-nav-agent-status.active      { background: var(--tc-green); box-shadow: 0 0 0 2px rgba(22,163,74,.25); }
.tc-nav-agent-status.error       { background: var(--tc-red); }
.tc-nav-agent-status.configuring { background: var(--tc-orange); }

.tc-nav-section--agents {
    background: linear-gradient(90deg, rgba(124,58,237,.07), transparent);
    border-radius: 6px;
    padding-left: 10px;
    color: var(--tc-purple);
}

/* ── Header icon agent ── */
.tc-header-agent-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 8px;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ════════════════════════════════════
   HUB — Grille agents
   ════════════════════════════════════ */
.tc-agents-hub {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Zone hero avec Hub central */
.tc-hub-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 0;
    position: relative;
}
.tc-hub-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 2;
}
.tc-hub-icon {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--tc-purple), #2563EB);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(124,58,237,.35);
    margin-bottom: 4px;
}
.tc-hub-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--tc-text);
}
.tc-hub-sublabel {
    font-size: 12px;
    color: var(--tc-text-soft);
}
.tc-hub-status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--tc-border);
    margin-top: 4px;
}
.tc-hub-status-dot.active { background: var(--tc-green); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.tc-hub-lines { display: none; }

/* Grille des agents */
.tc-agents-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    padding: 0 4px;
}

/* Carte agent */
.tc-agent-card {
    background: var(--tc-white);
    border-radius: var(--tc-radius);
    border: 1.5px solid var(--tc-border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    text-decoration: none;
    color: var(--tc-text);
    transition: all .2s;
    position: relative;
    overflow: hidden;
}
.tc-agent-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--tc-radius) var(--tc-radius) 0 0;
    opacity: 0;
    transition: opacity .2s;
}
.tc-agent-card:hover { box-shadow: var(--tc-shadow-md); transform: translateY(-2px); }
.tc-agent-card:hover::before { opacity: 1; }
.tc-agent-card--soon { opacity: .6; cursor: default; pointer-events: none; }
.tc-agent-card--soon:hover { transform: none; box-shadow: none; }

/* Couleurs par agent */
.tc-agent-card--blue::before   { background: var(--tc-primary); }
.tc-agent-card--green::before  { background: var(--tc-green); }
.tc-agent-card--orange::before { background: var(--tc-orange); }
.tc-agent-card--purple::before { background: var(--tc-purple); }
.tc-agent-card--red::before    { background: var(--tc-red); }

.tc-agent-card-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.tc-agent-card-icon:has(.tc-agent-card-icon-img) {
    width: 80px;
    height: 80px;
    background: transparent;
}
.tc-agent-card-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
}
.tc-agent-card--blue   .tc-agent-card-icon { background: var(--tc-primary-light); color: var(--tc-primary); }
.tc-agent-card--blue   .tc-agent-card-icon svg { stroke: var(--tc-primary); }
.tc-agent-card--green  .tc-agent-card-icon { background: var(--tc-green-light);   color: var(--tc-green); }
.tc-agent-card--green  .tc-agent-card-icon svg { stroke: var(--tc-green); }
.tc-agent-card--orange .tc-agent-card-icon { background: var(--tc-orange-light);  color: var(--tc-orange); }
.tc-agent-card--orange .tc-agent-card-icon svg { stroke: var(--tc-orange); }
.tc-agent-card--purple .tc-agent-card-icon { background: var(--tc-purple-light);  color: var(--tc-purple); }
.tc-agent-card--purple .tc-agent-card-icon svg { stroke: var(--tc-purple); }
.tc-agent-card--red    .tc-agent-card-icon { background: var(--tc-red-light);     color: var(--tc-red); }
.tc-agent-card--red    .tc-agent-card-icon svg { stroke: var(--tc-red); }

.tc-agent-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--tc-text);
}
.tc-agent-card-desc {
    font-size: 11.5px;
    color: var(--tc-text-soft);
    line-height: 1.5;
    flex: 1;
}
.tc-agent-card-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--tc-border);
    gap: 6px;
}
.tc-agent-status-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.tc-agent-status-badge.active      { background: var(--tc-green-light);   color: var(--tc-green); }
.tc-agent-status-badge.inactive    { background: var(--tc-bg);             color: var(--tc-text-soft); }
.tc-agent-status-badge.configuring { background: var(--tc-orange-light);  color: var(--tc-orange); }
.tc-agent-status-badge.error       { background: var(--tc-red-light);     color: var(--tc-red); }

.tc-agent-configure { font-size: 11px; color: var(--tc-primary); font-weight: 600; }
.tc-agent-coming    { font-size: 10.5px; color: var(--tc-text-soft); background: var(--tc-bg); padding: 2px 8px; border-radius: 20px; }

/* ════════════════════════════════════
   NOVA — Interface agent email
   ════════════════════════════════════ */
.tc-nova-wrap { display: flex; flex-direction: column; gap: 0; }

/* Barre de navigation horizontale Nova */
.tc-nova-tabs-bar {
    display: flex;
    gap: 2px;
    background: var(--tc-white);
    border-bottom: 1.5px solid var(--tc-border);
    padding: 10px 20px 0;
    overflow-x: auto;
}
.tc-nova-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tc-text-soft);
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .18s;
    font-family: var(--tc-font);
    position: relative;
}
.tc-nova-tab:hover { color: var(--tc-text); background: var(--tc-bg); border-radius: 8px 8px 0 0; }
.tc-nova-tab.active { color: var(--tc-primary); font-weight: 600; border-bottom-color: var(--tc-primary); background: none; }
.tc-nova-tab svg { width: 14px; height: 14px; stroke: currentColor; }
.tc-nova-tab-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--tc-border);
    position: absolute;
    top: 8px; right: 8px;
}
.tc-nova-tab-dot.connected { background: var(--tc-green); }

/* Panneaux Nova */
.tc-nova-panel { display: none; padding: 20px; }
.tc-nova-panel.active { display: block; }

/* Header de section */
.tc-nova-section-header { margin-bottom: 18px; }
.tc-nova-section-header h3 { font-size: 15px; font-weight: 700; color: var(--tc-text); margin-bottom: 5px; }
.tc-nova-section-header p  { font-size: 13px; color: var(--tc-text-soft); line-height: 1.6; }

/* Carte setup vide */
.tc-nova-setup-card { border: none; background: var(--tc-bg); box-shadow: none; overflow: visible; }
.tc-nova-setup-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    gap: 0;
}
.tc-nova-setup-visual {
    flex: 0 0 260px;
    width: 260px;
    min-width: 260px;
    height: 300px;
    overflow: hidden;
    border-radius: var(--tc-radius) 0 0 var(--tc-radius);
    border: 2px dashed var(--tc-border);
    border-right: none;
}
.tc-nova-setup-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}
.tc-nova-setup-inner {
    flex: 0 0 auto;
    width: 340px;
    padding: 36px 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border: 2px dashed var(--tc-border);
    border-radius: 0 var(--tc-radius) var(--tc-radius) 0;
    height: 300px;
    justify-content: center;
    box-sizing: border-box;
}
.tc-nova-setup-icon { margin-bottom: 4px; opacity: .7; }
.tc-nova-setup-inner h3  { font-size: 16px; font-weight: 700; }
.tc-nova-setup-inner p   { font-size: 13.5px; color: var(--tc-text-soft); max-width: 300px; line-height: 1.6; }
@media (max-width: 700px) {
    .tc-nova-setup-row { flex-direction: column; padding: 24px 16px; }
    .tc-nova-setup-visual { width: 100%; flex: 0 0 200px; height: 200px; min-width: 0; border-radius: var(--tc-radius) var(--tc-radius) 0 0; border: 2px dashed var(--tc-border); border-bottom: none; }
    .tc-nova-setup-inner { width: 100%; height: auto; border-radius: 0 0 var(--tc-radius) var(--tc-radius); border: 2px dashed var(--tc-border); border-top: none; }
}

/* Grille providers */
.tc-nova-provider-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.tc-nova-provider-grid--crm { grid-template-columns: repeat(4, 1fr); }

.tc-nova-provider-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--tc-bg);
    border: 2px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    cursor: pointer;
    transition: all .18s;
    font-family: var(--tc-font);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tc-text);
}
.tc-nova-provider-btn:hover { border-color: var(--tc-primary); background: var(--tc-primary-light); color: var(--tc-primary); }
.tc-nova-provider-btn.selected { border-color: var(--tc-primary); background: var(--tc-primary-light); }
.tc-nova-provider-btn--native { border-color: var(--tc-green); background: var(--tc-green-light); }
.tc-nova-provider-btn--native:hover { border-color: var(--tc-green); background: var(--tc-green-light); color: var(--tc-green); }
.tc-nova-provider-icon { font-size: 22px; }
.tc-nova-provider-badge { font-size: 13px; font-weight: 700; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.tc-nova-native-tag { font-size: 10px; color: var(--tc-green); font-weight: 600; }

/* Formulaires de configuration */
.tc-nova-config-form {
    background: var(--tc-bg);
    border-radius: var(--tc-radius-sm);
    padding: 20px;
    border: 1.5px solid var(--tc-border);
}
.tc-nova-form-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.tc-nova-form-header h4 { font-size: 14px; font-weight: 700; color: var(--tc-text); }
.tc-nova-fields { display: flex; flex-direction: column; gap: 14px; }
.tc-nova-form-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }

/* Champs de formulaire */
.tc-form-row { display: flex; flex-direction: column; gap: 6px; }
.tc-label { font-size: 12.5px; font-weight: 600; color: var(--tc-text); }
.tc-required { color: var(--tc-red); margin-left: 3px; }
.tc-field-help { font-size: 11.5px; color: var(--tc-text-soft); line-height: 1.5; }
.tc-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* Connecteurs existants */
.tc-nova-connectors-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.tc-nova-connector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--tc-white);
    border: 1.5px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    padding: 12px 16px;
    gap: 12px;
}
.tc-nova-connector-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.tc-nova-connector-label { font-size: 13.5px; font-weight: 600; color: var(--tc-text); }
.tc-nova-connector-status { font-size: 11.5px; color: var(--tc-text-soft); }
.tc-nova-connector-error { font-size: 11.5px; color: var(--tc-red); }
.tc-nova-conn-active { background: var(--tc-green-light); border-color: rgba(22,163,74,.25) !important; }
.tc-nova-connector-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Workflows */
/* ── Workflow cards (configurés) ── */
.tc-nova-workflow-card {
    padding: 14px 20px;
    border-bottom: 1px solid var(--tc-border);
    transition: background 0.15s;
}
.tc-nova-workflow-card:last-child { border-bottom: none; }
.tc-nova-workflow-card.is-inactive { opacity: 0.6; }
.tc-nova-workflow-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.tc-nova-workflow-card-info { display: flex; align-items: center; gap: 8px; }
.tc-nova-workflow-name { font-size: 13.5px; font-weight: 600; color: var(--tc-text); }
.tc-nova-workflow-card-meta { display: flex; flex-direction: column; gap: 6px; }
.tc-nova-workflow-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.tc-nova-workflow-meta-label {
    color: var(--tc-text-soft);
    min-width: 76px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tc-nova-workflow-steps {
    font-size: 12px;
    color: var(--tc-text);
}

/* legacy (non utilisé mais conservé pour compatibilité) */
.tc-nova-workflow-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--tc-border);
    gap: 12px;
}
.tc-nova-workflow-row:last-child { border-bottom: none; }
.tc-nova-workflow-info { display: flex; align-items: center; gap: 10px; flex: 1; }

/* Suggestions de workflows */
.tc-nova-empty-state {
    text-align: center;
    padding: 20px 0 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.tc-nova-empty-state svg { opacity: .2; }
.tc-nova-empty-state p { font-size: 13px; color: var(--tc-text-soft); }
.tc-nova-default-workflows { width: 100%; margin-top: 10px; text-align: left; }
.tc-nova-workflow-suggestions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.tc-nova-wf-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tc-bg);
    border: 1.5px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    padding: 12px 16px;
}
.tc-nova-wf-suggestion-name { font-size: 13px; font-weight: 600; color: var(--tc-text); min-width: 180px; }
.tc-nova-wf-suggestion-desc { font-size: 12px; color: var(--tc-text-soft); flex: 1; line-height: 1.4; }

/* ── Config inline par workflow ── */
.tc-nova-wf-config {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--tc-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tc-nova-wf-config-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tc-nova-wf-config-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--tc-text-soft);
    white-space: nowrap;
    min-width: 110px;
}
.tc-nova-wf-config-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Détails config IA (expandable) */
.tc-nova-wf-ai-details {
    border: 1px solid var(--tc-border);
    border-radius: 6px;
    overflow: hidden;
}
.tc-nova-wf-ai-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tc-text-soft);
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: var(--tc-bg-alt, #f8f9fb);
}
.tc-nova-wf-ai-summary::-webkit-details-marker { display: none; }
.tc-nova-wf-ai-details[open] .tc-nova-wf-ai-summary { border-bottom: 1px solid var(--tc-border); }
.tc-nova-wf-ai-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.tc-nova-wf-ai-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--tc-text);
    cursor: pointer;
}
.tc-nova-wf-ai-check input[type="checkbox"] { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Sections Mission / Étapes / Règlement ── */
.tc-nova-wf-config-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tc-nova-wf-section-title {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--tc-text);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.tc-nova-wf-section-hint {
    font-size: 10px;
    font-weight: 400;
    color: var(--tc-text-soft);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

/* ── Étapes ── */
.tc-nova-wf-steps { display: flex; flex-direction: column; gap: 6px; }
.tc-nova-wf-step {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--tc-bg-alt, #f8f9fb);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    padding: 7px 10px;
}
.tc-nova-wf-step-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--tc-primary);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.tc-nova-wf-step-body {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.tc-nova-wf-step-label {
    flex: 1;
    font-size: 12px;
    min-width: 0;
}
.tc-nova-wf-step-tool {
    font-size: 11px;
    padding: 4px 8px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    background: var(--tc-bg);
    color: var(--tc-text);
    cursor: pointer;
    flex-shrink: 0;
    height: 32px;
}
.tc-nova-wf-step-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tc-text-soft);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.tc-nova-wf-step-remove:hover { color: var(--tc-danger, #e74c3c); background: color-mix(in srgb, var(--tc-danger, #e74c3c) 10%, transparent); }
.tc-nova-wf-add-step {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: var(--tc-primary);
    background: none;
    border: 1px dashed var(--tc-primary);
    border-radius: var(--tc-radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s;
    width: fit-content;
    opacity: 0.8;
}
.tc-nova-wf-add-step:hover { opacity: 1; background: color-mix(in srgb, var(--tc-primary) 6%, transparent); }

/* ── Créer workflow personnalisé ── */
.tc-nova-wf-custom-create {
    margin-top: 12px;
}
.tc-nova-wf-custom-create-inner { text-align: center; }
.tc-nova-wf-custom-create-form {
    flex-direction: column;
    gap: 8px;
    background: var(--tc-bg-alt, #f8f9fb);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    padding: 16px;
}

/* ── Tester maintenant ── */
.tc-nova-run-now-card { border: 1px dashed var(--tc-primary); background: color-mix(in srgb, var(--tc-primary) 4%, transparent); }
.tc-nova-run-now-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ── Grille de workflows (4 cartes par ligne) ── */
.tc-nova-wf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 16px 0 4px;
}
@media (max-width: 1200px) { .tc-nova-wf-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  { .tc-nova-wf-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .tc-nova-wf-grid { grid-template-columns: 1fr; } }

/* ── Carte workflow (grille) — effet ombre glass ── */
.tc-nova-wf-grid-card {
    background: rgba(255, 255, 255, 0.65);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    border-radius: 14px;
    box-shadow:
        0 8px 32px rgba(37, 99, 235, 0.13),
        0 2px 8px rgba(0, 0, 0, 0.09),
        inset 0 1.5px 0 rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    cursor: pointer;
    transition: border-color .2s, box-shadow .22s, transform .18s, background .2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
/* Barre accent colorée en haut */
.tc-nova-wf-grid-card::before {
    content: '';
    display: block;
    height: 3px;
    background: rgba(203, 213, 225, 0.7);
    transition: background .2s;
    flex-shrink: 0;
}
.tc-nova-wf-grid-card.is-active::before {
    background: linear-gradient(90deg, var(--tc-primary), #60a5fa);
}
.tc-nova-wf-grid-card:hover {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow:
        0 16px 48px rgba(37, 99, 235, 0.18),
        0 4px 14px rgba(0, 0, 0, 0.10),
        inset 0 1.5px 0 rgba(255, 255, 255, 1);
    transform: translateY(-4px);
}
.tc-nova-wf-grid-card.is-inactive { opacity: 0.58; }
.tc-nova-wf-grid-card.is-inactive:hover { opacity: 0.80; }

/* Corps de la carte (padding interne) */
.tc-nova-wf-grid-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 14px 8px;
}
.tc-nova-wf-grid-card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--tc-text);
    line-height: 1.35;
    flex: 1;
}
.tc-nova-wf-grid-card-badge {
    font-size: 9.5px !important;
    padding: 2px 7px !important;
    flex-shrink: 0;
}

/* Zone trigger + étapes */
.tc-nova-wf-grid-card-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 0 14px 12px;
    flex: 1;
}
.tc-nova-wf-grid-card-trigger {
    font-size: 10px !important;
    padding: 2px 8px !important;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tc-nova-wf-grid-card-step-list {
    font-size: 11px;
    color: var(--tc-text-soft);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer carte (toggle + compteur) */
.tc-nova-wf-grid-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-top: 1px solid var(--tc-border);
    background: var(--tc-bg);
}
.tc-nova-wf-grid-card-step-count {
    font-size: 11px;
    color: var(--tc-text-soft);
    font-weight: 500;
}

/* ── Modal workflow Nova ── */
.tc-nova-wf-modal-inner { max-width: 860px; }
.tc-nova-wf-modal-body  { gap: 20px; }
/* Étapes dans le modal — zone plus grande */
#tc-nova-wf-modal .tc-nova-wf-steps { min-height: 80px; gap: 8px; }
#tc-nova-wf-modal .tc-nova-wf-step  { padding: 10px 12px; }
#tc-nova-wf-modal .tc-nova-wf-step-label { font-size: 13px; height: 36px; }
#tc-nova-wf-modal .tc-nova-wf-step-tool  { font-size: 12px; height: 36px; }
#tc-nova-wf-modal .tc-nova-wf-add-step   { padding: 9px 16px; font-size: 12px; }
/* Config IA dans le modal — plus spacieuse */
#tc-nova-wf-modal .tc-nova-wf-ai-details { border-radius: 10px; }
#tc-nova-wf-modal .tc-nova-wf-ai-summary { padding: 12px 16px; font-size: 13px; }
#tc-nova-wf-modal .tc-nova-wf-ai-body    { padding: 14px 16px; gap: 10px; }
#tc-nova-wf-modal .tc-nova-wf-ai-check   { font-size: 13px; gap: 10px; }
#tc-nova-wf-modal .tc-nova-wf-ai-check input[type="checkbox"] { width: 16px; height: 16px; }
/* Mots-clés — champ pleine hauteur */
#tc-nova-wf-modal #tc-nova-wf-modal-keywords { height: 44px; font-size: 14px; }
.tc-nova-wf-modal-hint  {
    font-size: 11px;
    font-weight: 400;
    color: var(--tc-text-soft);
    margin-left: 5px;
}
/* Alignement icône + texte dans les labels du modal */
#tc-nova-wf-modal .tc-label {
    display: flex;
    align-items: center;
    gap: 5px;
}
.tc-nova-run-now-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--tc-primary); margin-bottom: 4px; }
.tc-nova-run-now-desc { font-size: 12px; color: var(--tc-text-soft); }
.tc-nova-run-summary { font-size: 12px; font-weight: 600; color: var(--tc-text-soft); margin-bottom: 10px; }
.tc-nova-run-result {
    background: var(--tc-bg);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
}
.tc-nova-run-result:last-child { margin-bottom: 0; }
.tc-nova-run-result.is-skipped { opacity: 0.55; }
.tc-nova-run-result-from { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--tc-text); margin-bottom: 2px; }
.tc-nova-run-result-subject { font-size: 13px; color: var(--tc-text); margin-bottom: 8px; font-style: italic; }
.tc-nova-run-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tc-nova-run-label { font-size: 11px; color: var(--tc-text-soft); }
.tc-nova-run-intention {
    font-size: 12px;
    color: var(--tc-text-soft);
    margin: 6px 0;
    padding: 6px 10px;
    background: var(--tc-bg-alt);
    border-left: 3px solid var(--tc-primary);
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
}
.tc-nova-run-custom-output {
    font-size: 12px;
    color: var(--tc-text);
    margin: 8px 0 2px;
    padding: 10px 12px;
    background: var(--tc-bg-alt);
    border: 1px solid var(--tc-border);
    border-radius: 6px;
    line-height: 1.6;
    white-space: normal;
}
.tc-nova-run-co-heading {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--tc-primary);
    margin-top: 8px;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.tc-nova-run-co-heading:first-child { margin-top: 0; }
.tc-nova-run-co-bullet {
    display: block;
    padding-left: 10px;
    color: var(--tc-text-soft);
}

/* Règles */
.tc-nova-rules-list { display: flex; flex-direction: column; gap: 8px; }
.tc-nova-rule-row { display: flex; align-items: center; gap: 8px; }

/* Logs */
.tc-nova-logs-body { overflow-x: auto; }

/* Responsive agents */
@media (max-width: 1100px) {
    .tc-agents-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .tc-agents-grid { grid-template-columns: repeat(2, 1fr); }
    .tc-nova-provider-grid { grid-template-columns: repeat(2, 1fr); }
    .tc-nova-provider-grid--crm { grid-template-columns: repeat(2, 1fr); }
    .tc-nova-wf-suggestion { flex-direction: column; align-items: flex-start; }
    .tc-nova-email-row { flex-direction: column; }
    .tc-nova-card--period { flex: none; width: 100%; }
}
@media (max-width: 768px) {
    .tc-planning-aside { display: none; }
    .tc-planning-header-search { display: none; }
    .tc-pv-btn { padding: 5px 9px; font-size: 12px; }
    .tc-cal-label { min-width: 120px; font-size: 12px; }
}

/* ── Nova — formulaires provider (affichage dynamique) ── */
.tc-nova-provider-form { display: none; margin-top: 16px; }
.tc-nova-provider-btn.active { border-color: var(--tc-primary); background: var(--tc-primary-light); color: var(--tc-primary); }

/* ── Nova — toast de notification ── */
#tc-nova-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    padding: 12px 20px;
    border-radius: var(--tc-radius);
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    max-width: 340px;
}
#tc-nova-toast.visible { opacity: 1; transform: translateY(0); }
#tc-nova-toast.tc-nova-toast--success { background: var(--tc-green); }
#tc-nova-toast.tc-nova-toast--error   { background: var(--tc-red); }
#tc-nova-toast.tc-nova-toast--info    { background: var(--tc-primary); }

/* ── Nova — champs de formulaire génériques ── */
.tc-nova-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.tc-nova-form-field { display: flex; flex-direction: column; gap: 4px; }
.tc-nova-form-field label { font-size: 12px; font-weight: 600; color: var(--tc-text-soft); text-transform: uppercase; letter-spacing: .04em; }
.tc-nova-form-field input,
.tc-nova-form-field select,
.tc-nova-form-field textarea { width: 100%; }

/* ── Nova — connecteurs existants (liste) ── */
.tc-nova-connector-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.tc-nova-connector-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--tc-radius);
    border: 1.5px solid var(--tc-border);
    background: var(--tc-white);
}
.tc-nova-connector-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--tc-text); }
.tc-nova-connector-provider { font-size: 12px; color: var(--tc-text-soft); }
.tc-nova-connector-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.tc-nova-connector-status--active   { background: var(--tc-green-light);  color: var(--tc-green); }
.tc-nova-connector-status--error    { background: var(--tc-red-light);    color: var(--tc-red); }
.tc-nova-connector-status--pending  { background: var(--tc-orange-light); color: var(--tc-orange); }

/* ── Nova — logs table ── */
.tc-nova-logs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tc-nova-logs-table th { background: var(--tc-bg); padding: 8px 12px; text-align: left; font-weight: 600; color: var(--tc-text-soft); font-size: 11px; text-transform: uppercase; border-bottom: 1.5px solid var(--tc-border); }
.tc-nova-logs-table td { padding: 8px 12px; border-bottom: 1px solid var(--tc-border); color: var(--tc-text); vertical-align: middle; }
.tc-nova-logs-table tr:last-child td { border-bottom: none; }
.tc-nova-log-status { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.tc-nova-log-status--success { background: var(--tc-green-light); color: var(--tc-green); }
.tc-nova-log-status--error   { background: var(--tc-red-light);   color: var(--tc-red); }

/* ═══════════════════════════════════════════════════════════════
   Modal Créer une tâche
   ═══════════════════════════════════════════════════════════════ */

.tc-modal-overlay *, .tc-modal-overlay *::before, .tc-modal-overlay *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--tc-font);
}

.tc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.tc-modal {
    background: var(--tc-white);
    border-radius: var(--tc-radius);
    box-shadow: 0 24px 60px rgba(0,0,0,.18);
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: tcModalIn .18s ease;
}

@keyframes tcModalIn {
    from { transform: translateY(12px) scale(.98); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.tc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 16px;
    border-bottom: 1.5px solid var(--tc-border);
}

.tc-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--tc-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.tc-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tc-text-soft);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: background .15s, color .15s;
}
.tc-modal-close:hover { background: var(--tc-bg); color: var(--tc-text); }

.tc-modal-body {
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    max-height: calc(85vh - 130px);
}

.tc-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1.5px solid var(--tc-border);
    background: var(--tc-bg);
}

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

@media (max-width: 480px) {
    .tc-form-row-2col { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   Paramètres Planning — types de tâches
   ═══════════════════════════════════════════════════════════════ */

.tc-task-type-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--tc-radius-sm);
    border: 1px solid var(--tc-border);
    background: var(--tc-white);
    margin-bottom: 6px;
}

.tc-task-type-label {
    flex: 1;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tc-text);
}

.tc-input-date {
    height: 44px;
    padding: 10px 14px;
}

.tc-input-date::-webkit-calendar-picker-indicator {
    filter: invert(27%) sepia(98%) saturate(700%) hue-rotate(255deg) brightness(80%) contrast(110%);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.tc-task-type-form {
    padding-top: 10px;
    border-top: 1.5px dashed var(--tc-border);
    margin-top: 10px;
}
.tc-nova-log-status--info    { background: var(--tc-primary-light); color: var(--tc-primary); }

/* ═══════════════════════════════════════════════════════════════
   Composants UI partagés — tc-nova-card / btn / badge / notice / form
   ═══════════════════════════════════════════════════════════════ */

/* ── Ligne Gmail + Période côte à côte ── */
.tc-nova-email-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 0;
}
.tc-nova-email-row > .tc-nova-card { margin-bottom: 16px; }
.tc-nova-card--grow { flex: 1 1 0; min-width: 0; }
.tc-nova-card--period { flex: 0 0 340px; width: 340px; }

/* ── Cards ── */
.tc-nova-card {
    background: var(--tc-white);
    border: 1.5px solid var(--tc-border);
    border-radius: var(--tc-radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.tc-nova-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--tc-text);
    border-bottom: 1.5px solid var(--tc-border);
    background: var(--tc-bg);
}
.tc-nova-card-body { padding: 18px; }

/* ── Boutons ── */
.tc-nova-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--tc-radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tc-font);
    cursor: pointer;
    border: 1.5px solid var(--tc-border);
    background: var(--tc-white);
    color: var(--tc-text);
    transition: background .18s, border-color .18s, color .18s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.tc-nova-btn:hover { background: var(--tc-bg); border-color: #c8d0dc; }
.tc-nova-btn--sm   { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.tc-nova-btn--primary {
    background: var(--tc-primary);
    border-color: var(--tc-primary);
    color: #fff;
}
.tc-nova-btn--primary:hover { background: var(--tc-primary-dark); border-color: var(--tc-primary-dark); }
.tc-nova-btn--danger {
    background: var(--tc-red-light);
    border-color: var(--tc-red-light);
    color: var(--tc-red);
}
.tc-nova-btn--danger:hover { background: var(--tc-red); border-color: var(--tc-red); color: #fff; }

/* ── Badges ── */
.tc-nova-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--tc-bg);
    color: var(--tc-text-soft);
}
.tc-nova-badge--blue   { background: var(--tc-primary-light); color: var(--tc-primary); }
.tc-nova-badge--green  { background: var(--tc-green-light);   color: var(--tc-green); }
.tc-nova-badge--orange { background: var(--tc-orange-light);  color: var(--tc-orange); }
.tc-nova-badge--red    { background: var(--tc-red-light);     color: var(--tc-red); }
.tc-nova-badge--purple { background: var(--tc-purple-light);  color: var(--tc-purple); }

/* ── Notices ── */
.tc-nova-notice {
    padding: 10px 16px;
    border-radius: var(--tc-radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    border-left: 4px solid currentColor;
}
.tc-nova-notice.success { background: var(--tc-green-light);   color: var(--tc-green); }
.tc-nova-notice.error,
.tc-nova-notice.danger  { background: var(--tc-red-light);     color: var(--tc-red); }
.tc-nova-notice.info    { background: var(--tc-primary-light); color: var(--tc-primary); }

/* ── Champs de formulaire ── */
.tc-nova-form-group { display: flex; flex-direction: column; gap: 5px; }
.tc-nova-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--tc-text);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tc-nova-input,
.tc-nova-select {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 13px;
    font-family: var(--tc-font);
    color: var(--tc-text);
    background: var(--tc-white);
    transition: border-color .18s, box-shadow .18s;
    outline: none;
    appearance: none;
}
.tc-nova-input:focus,
.tc-nova-select:focus {
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}
.tc-nova-input::placeholder { color: var(--tc-text-soft); opacity: 1; }
.tc-nova-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ═══════════════════════════════════════════════════════════════
   Connections Manager (frontend shortcode)
   ═══════════════════════════════════════════════════════════════ */

.tc-conn-wrap { max-width: 100%; }

/* ── Lignes de connexion ── */
.tc-conn-list { padding: 0; }
.tc-conn-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--tc-border);
    flex-wrap: wrap;
}
.tc-conn-row:last-child { border-bottom: none; }
.tc-conn-row-svc-icon { font-size: 18px; flex-shrink: 0; }
.tc-conn-row-info { flex: 1; min-width: 140px; }
.tc-conn-row-info strong { display: block; font-size: 13px; font-weight: 700; color: var(--tc-text); }
.tc-conn-row-info span   { font-size: 11.5px; color: var(--tc-text-soft); }
.tc-conn-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.tc-conn-expires { font-size: 11px; color: var(--tc-text-soft); }
.tc-conn-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Toggle Global ── */
.tc-conn-toggle-wrap {
    position: relative;
    display: inline-block;
    width: 32px; height: 18px;
    cursor: pointer;
}
.tc-conn-toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }
.tc-conn-toggle-slider {
    position: absolute; inset: 0;
    background: var(--tc-border);
    border-radius: 18px;
    transition: background .2s;
}
.tc-conn-toggle-slider::before {
    content: '';
    position: absolute;
    width: 12px; height: 12px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}
.tc-conn-toggle-wrap input:checked + .tc-conn-toggle-slider { background: var(--tc-green); }
.tc-conn-toggle-wrap input:checked + .tc-conn-toggle-slider::before { transform: translateX(14px); }
.tc-conn-toggle-label { font-size: 11px; color: var(--tc-text-soft); }

/* ── Grille de services ── */
.tc-conn-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}
.tc-conn-service-option { cursor: pointer; }
.tc-conn-service-option input { display: none; }
.tc-conn-service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border: 2px solid var(--tc-border);
    border-radius: 10px;
    text-align: center;
    background: var(--tc-bg);
    transition: all .18s;
}
.tc-conn-service-option:hover .tc-conn-service-card,
.tc-conn-service-option input:checked + .tc-conn-service-card {
    border-color: var(--tc-primary);
    background: rgba(37,99,235,.06);
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}
.tc-conn-svc-icon { font-size: 20px; }
.tc-conn-svc-name { font-size: 11.5px; font-weight: 700; color: var(--tc-text); }
.tc-conn-svc-desc { font-size: 10px; color: var(--tc-text-soft); line-height: 1.3; }

/* ── URL de callback ── */
.tc-conn-callback-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--tc-bg);
    border: 1px solid var(--tc-border);
    border-radius: 8px;
    padding: 9px 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.tc-conn-callback-label { font-size: 11.5px; font-weight: 600; color: var(--tc-text-soft); flex-shrink: 0; }
.tc-conn-callback-code {
    flex: 1;
    font-size: 11.5px;
    color: var(--tc-primary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    word-break: break-all;
}

/* ── Block provider social/API ── */
.tc-conn-provider-block { margin-bottom: 24px; }
.tc-conn-provider-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--tc-text);
    margin-bottom: 10px;
}
.tc-conn-provider-label svg { width: 20px; height: 20px; }

/* ── Hint de service sélectionné ── */
.tc-conn-scope-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--tc-primary-light);
    border: 1.5px solid rgba(37,99,235,.15);
    border-radius: var(--tc-radius-sm);
    padding: 10px 14px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--tc-text);
    line-height: 1.5;
}
.tc-conn-hint-icon { font-size: 20px; flex-shrink: 0; line-height: 1.3; }
.tc-conn-hint-body { flex: 1; }
.tc-conn-hint-scopes {
    font-size: 11.5px;
    color: var(--tc-text-soft);
    margin-top: 4px;
}
.tc-conn-hint-scopes code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    color: var(--tc-primary);
    font-size: 11px;
    word-break: break-all;
}

/* ── Formulaire card ── */
.tc-conn-form-card { margin-top: 14px; }

/* ── Lignes IA ── */
.tc-conn-ia-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--tc-border);
    flex-wrap: wrap;
}
.tc-conn-ia-row:last-of-type { border-bottom: none; }
.tc-conn-ia-info { flex: 0 0 160px; min-width: 100px; display: flex; align-items: center; gap: 8px; }
.tc-conn-ia-key { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-conn-ia-mask {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 11.5px;
    color: var(--tc-text-soft);
}

/* ── Nova — toggle activation agent (dans la KPI row) ── */
.tc-nova-agent-toggle-wrap {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}
.tc-nova-agent-toggle-wrap--disabled { opacity: .45; cursor: not-allowed; }

.tc-nova-agent-toggle-wrap input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.tc-nova-agent-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 28px;
    transition: background .2s;
}
.tc-nova-agent-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 4px;
    top: 4px;
    background: #fff;
    border-radius: 50%;
    transition: transform .22s;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.tc-nova-agent-toggle-wrap input:checked + .tc-nova-agent-toggle-slider {
    background: var(--tc-success, #16a34a);
}
.tc-nova-agent-toggle-wrap input:checked + .tc-nova-agent-toggle-slider::before {
    transform: translateX(24px);
}
.tc-nova-agent-toggle-wrap input:disabled + .tc-nova-agent-toggle-slider { opacity: .5; }

@media (max-width: 640px) {
    .tc-conn-row { flex-direction: column; align-items: flex-start; }
    .tc-conn-services-grid { grid-template-columns: 1fr 1fr; }
    .tc-conn-ia-info { flex: 1; }
}

/* ── Toast notifications ── */
.tc-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.tc-toast.tc-toast-visible  { opacity: 1; transform: translateY(0); }
.tc-toast-success           { background: var(--tc-green); }
.tc-toast-error             { background: var(--tc-red); }