/* =============================================================================
   TELANODE DESIGN SYSTEM — COLLAB
   Version 1.0
   =============================================================================
   Préfixe : tn-
   Palette : FileManager COLLAB (Proposition B "FM ELEVATED")
   Font    : Segoe UI / system-ui, 12px base
   Modes   : Light (défaut) + Dark via [data-theme="dark"]
   
   Usage :
   ┌─────────────────────────────────────────────────────────────────────┐
   │  Chargé UNE FOIS par le layout principal (ou shell d'un module).  │
   │  Les fragments AJAX et panels utilisent directement les classes.   │
   │  Aucune dépendance externe (pas de Bootstrap requis).             │
   └─────────────────────────────────────────────────────────────────────┘
   
   Sections :
     1. DESIGN TOKENS          — Variables CSS, light + dark
     2. LAYOUT                 — App shell, sidebar, main, toolbar, content
     3. TYPOGRAPHY             — Headings, text utilities
     4. CARD                   — Cards avec accents couleur
     5. ROW                    — Lignes paramètre (label + contrôle)
     6. FORM                   — Inputs, selects, textarea, checkbox, radio, form-row
     7. BUTTON                 — Primary, secondary, danger, ghost, sizes
     8. TABLE                  — Tableau compact avec hover
     9. LIST                   — Listes à items (icône + actions)
    10. TOGGLE                 — Switch on/off
    11. BADGE / PILL           — Indicateurs de statut
    12. TABS                   — Onglets horizontaux, scope switcher
    13. MODAL                  — Overlay + tailles
    14. TOAST                  — Notifications temporaires
    15. EMPTY STATE            — Placeholder quand pas de données
    16. LOADER                 — Spinner, skeleton
    17. SCROLLBAR              — Scrollbar personnalisée
    18. ANIMATIONS             — Keyframes réutilisables
    19. UTILITIES              — Spacing, visibility, flex, text
   ============================================================================= */


/* =============================================================================
   1. DESIGN TOKENS
   ============================================================================= */

:root {
    /* --- Surface --- */
    --tn-bg-primary:    #ffffff;
    --tn-bg-secondary:  #f9fafb;
    --tn-bg-tertiary:   #f3f4f6;
    --tn-bg-hover:      #e5e7eb;
    --tn-bg-selected:   #dbeafe;
    --tn-bg-backdrop:   rgba(0, 0, 0, .4);

    /* --- Border --- */
    --tn-border:        #e5e7eb;
    --tn-border-light:  #f3f4f6;

    /* --- Text --- */
    --tn-text-1:  #1f2937;
    --tn-text-2:  #4b5563;
    --tn-text-3:  #6b7280;
    --tn-text-4:  #9ca3af;

    /* --- Shadow --- */
    --tn-shadow-xs:  0 1px 2px rgba(0,0,0,.04);
    --tn-shadow-sm:  0 1px 3px rgba(0,0,0,.06);
    --tn-shadow-md:  0 4px 12px rgba(0,0,0,.08);
    --tn-shadow-lg:  0 8px 24px rgba(0,0,0,.12);

    /* --- Brand / Accent --- */
    --tn-accent:       #3b82f6;
    --tn-accent-dark:  #2563eb;
    --tn-accent-light: #dbeafe;
    --tn-accent-bg:    rgba(59,130,246,.08);

    /* --- Status --- */
    --tn-success:       #22c55e;
    --tn-success-light: #dcfce7;
    --tn-warning:       #f59e0b;
    --tn-warning-light: #fef3c7;
    --tn-danger:        #ef4444;
    --tn-danger-light:  #fee2e2;
    --tn-info:          #06b6d4;
    --tn-info-light:    #cffafe;

    /* --- Sidebar (always dark) --- */
    --tn-side-bg:         #1f2937;
    --tn-side-bg-deep:    #111827;
    --tn-side-border:     #374151;
    --tn-side-text:       #d1d5db;
    --tn-side-text-muted: #6b7280;
    --tn-side-hover:      #374151;
    --tn-side-active:     rgba(59,130,246,.15);

    /* --- Font --- */
    --tn-font:       'Segoe UI', system-ui, -apple-system, sans-serif;
    --tn-font-mono:  'Consolas', 'Courier New', monospace;
    --tn-font-size:  12px;

    /* --- Radius --- */
    --tn-radius-sm:  4px;
    --tn-radius:     6px;
    --tn-radius-lg:  8px;
    --tn-radius-xl:  10px;
    --tn-radius-full: 9999px;

    /* --- Transition --- */
    --tn-speed: .15s;
    --tn-ease:  ease;

    /* --- Card background (alias sémantique) --- */
    --tn-bg-card: var(--tn-bg-primary);

    /* --- Accent RGB (pour usage rgba) --- */
    --tn-accent-rgb: 59, 130, 246;

    /* --- Spacing system --- */
    --tn-spacing-xs: 4px;
    --tn-spacing-sm: 8px;
    --tn-spacing-md: 16px;
    --tn-spacing-lg: 24px;
    --tn-spacing-xl: 32px;

    /* --- Font sizes --- */
    --tn-font-size-xs: 10px;
    --tn-font-size-sm: 12px;
    --tn-font-size-base: 14px;
    --tn-font-size-lg: 16px;
    --tn-font-size-xl: 18px;
    --tn-font-size-2xl: 24px;
    --tn-font-size-3xl: 30px;
}

/* --- DARK MODE --- */
[data-theme="dark"] {
    --tn-bg-primary:    #1f2937;
    --tn-bg-secondary:  #111827;
    --tn-bg-tertiary:   #374151;
    --tn-bg-hover:      #4b5563;
    --tn-bg-selected:   #1e3a5f;
    --tn-bg-backdrop:   rgba(0, 0, 0, .6);

    --tn-border:        #374151;
    --tn-border-light:  #4b5563;

    --tn-text-1:  #f9fafb;
    --tn-text-2:  #e5e7eb;
    --tn-text-3:  #9ca3af;
    --tn-text-4:  #6b7280;

    --tn-shadow-xs:  0 1px 2px rgba(0,0,0,.15);
    --tn-shadow-sm:  0 1px 3px rgba(0,0,0,.2);
    --tn-shadow-md:  0 4px 12px rgba(0,0,0,.3);
    --tn-shadow-lg:  0 8px 24px rgba(0,0,0,.4);

    --tn-accent-light: #1e3a5f;
    --tn-accent-bg:    rgba(59,130,246,.12);

    --tn-success-light: rgba(34,197,94,.15);
    --tn-warning-light: rgba(245,158,11,.15);
    --tn-danger-light:  rgba(239,68,68,.15);
    --tn-info-light:    rgba(6,182,212,.15);
}


/* --- Base body --- */
body {
    background-color: var(--tn-bg-secondary);
    color: var(--tn-text-1);
    font-family: var(--tn-font);
    font-size: var(--tn-font-size);
    line-height: 1.5;
    margin: 0;
}


/* =============================================================================
   2. LAYOUT
   ============================================================================= */

/* --- App shell --- */
.tn-app {
    display: flex;
    height: 100%;
    background: var(--tn-bg-secondary);
    font-family: var(--tn-font);
    font-size: var(--tn-font-size);
    color: var(--tn-text-1);
    line-height: 1.5;
}

.tn-app *, .tn-app *::before, .tn-app *::after {
    box-sizing: border-box;
}

/* --- Sidebar (always dark) --- */
.tn-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--tn-side-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: width .2s var(--tn-ease), min-width .2s var(--tn-ease);
}

.tn-sidebar.collapsed {
    width: 0;
    min-width: 0;
}

/* Sidebar header */
.tn-side-header {
    height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--tn-side-border);
    flex-shrink: 0;
}

.tn-side-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--tn-radius);
    background: linear-gradient(135deg, var(--tn-accent), var(--tn-accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}

.tn-side-header-text {
    font-size: 13px;
    font-weight: 600;
    color: #f9fafb;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar search */
.tn-side-search {
    padding: 10px 12px;
    border-bottom: 1px solid var(--tn-side-border);
    flex-shrink: 0;
}

.tn-side-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--tn-side-bg-deep);
    border: 1px solid var(--tn-side-border);
    border-radius: var(--tn-radius);
}

.tn-side-search-wrap i {
    font-size: 11px;
    color: var(--tn-side-text-muted);
    flex-shrink: 0;
}

.tn-side-search-wrap input {
    border: none;
    background: transparent;
    color: var(--tn-side-text);
    font-size: 12px;
    font-family: inherit;
    width: 100%;
    outline: none;
}

.tn-side-search-wrap input::placeholder {
    color: var(--tn-side-text-muted);
}

/* Sidebar navigation */
.tn-side-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.tn-side-nav::-webkit-scrollbar       { width: 3px; }
.tn-side-nav::-webkit-scrollbar-thumb  { background: var(--tn-side-border); border-radius: 2px; }
.tn-side-nav::-webkit-scrollbar-track  { background: transparent; }

/* Nav category */
.tn-nav-category {
    padding: 14px 16px 5px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tn-side-text-muted);
}

/* Nav item */
.tn-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 20px;
    margin: 1px 8px;
    font-size: 12px;
    font-weight: 400;
    color: var(--tn-side-text);
    cursor: pointer;
    border: none;
    background: none;
    width: calc(100% - 16px);
    text-align: left;
    border-radius: 5px;
    border-left: 2px solid transparent;
    transition: all var(--tn-speed) var(--tn-ease);
    text-decoration: none;
    font-family: inherit;
}

.tn-nav-item:hover {
    background: var(--tn-side-hover);
}

.tn-nav-item.active {
    background: var(--tn-side-active);
    color: var(--tn-accent);
    border-left-color: var(--tn-accent);
    font-weight: 600;
}

.tn-nav-item i {
    width: 16px;
    text-align: center;
    font-size: 11px;
    opacity: .6;
    flex-shrink: 0;
}

.tn-nav-item:hover i,
.tn-nav-item.active i { opacity: 1; }

.tn-nav-item .count {
    margin-left: auto;
    font-size: 10px;
    color: var(--tn-side-text-muted);
}

.tn-nav-item.active .count { color: var(--tn-accent); }

/*
 * Light nav context — remap sidebar tokens to main theme tokens.
 * Place this class on the <nav> or any ancestor of .tn-nav-item / .tn-nav-category.
 * Works in both light and dark themes automatically.
 */
.tn-nav-light {
    --tn-side-text:       var(--tn-text-2);
    --tn-side-text-muted: var(--tn-text-4);
    --tn-side-hover:      var(--tn-bg-tertiary);
    --tn-side-active:     var(--tn-accent-bg);
    --tn-side-border:     var(--tn-border);
}

/* Sidebar footer */
.tn-side-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--tn-side-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tn-side-footer-text {
    font-size: 10px;
    color: var(--tn-side-text-muted);
}

/* --- Main --- */
.tn-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* --- Toolbar --- */
.tn-toolbar {
    height: 48px;
    background: var(--tn-bg-primary);
    border-bottom: 1px solid var(--tn-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    flex-shrink: 0;
}

.tn-tb-toggle {
    width: 30px;
    height: 30px;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-sm);
    background: var(--tn-bg-primary);
    color: var(--tn-text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all var(--tn-speed);
}

.tn-tb-toggle:hover {
    background: var(--tn-bg-hover);
    color: var(--tn-text-1);
}

.tn-tb-crumb {
    font-size: 11px;
    color: var(--tn-text-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tn-tb-crumb .sep { color: var(--tn-text-4); }

.tn-tb-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tn-text-1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tn-tb-title i { color: var(--tn-accent); font-size: 12px; }

.tn-tb-sep {
    width: 1px;
    height: 20px;
    background: var(--tn-border);
    margin: 0 4px;
}

.tn-tb-spacer { flex: 1; }

/* Toolbar icon button */
.tn-tb-btn {
    width: 30px;
    height: 30px;
    background: var(--tn-bg-primary);
    color: var(--tn-text-2);
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--tn-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tn-tb-btn:hover {
    background: var(--tn-bg-hover);
    color: var(--tn-text-1);
}

/* --- Content zone --- */
.tn-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: var(--tn-bg-secondary);
}

/* --- Fragment (AJAX-loaded view wrapper) --- */
.tn-fragment {
    padding: 16px 20px;
}

.tn-fragment.compact {
    padding: 10px 14px;
}

.tn-fragment.flush {
    padding: 0;
}

/* Fragment header — standard title + actions bar at top of every fragment */
.tn-frag-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    min-height: 32px;
}

.tn-frag-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tn-text-1);
    line-height: 1.3;
}

.tn-frag-title i {
    font-size: 14px;
    color: var(--tn-text-3);
}

.tn-frag-desc {
    font-size: 11px;
    color: var(--tn-text-4);
    margin-top: 1px;
}

.tn-frag-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}


/* =============================================================================
   3. TYPOGRAPHY
   ============================================================================= */

.tn-h1 { font-size: 20px; font-weight: 700; color: var(--tn-text-1); line-height: 1.3; }
.tn-h2 { font-size: 16px; font-weight: 600; color: var(--tn-text-1); line-height: 1.3; }
.tn-h3 { font-size: 14px; font-weight: 600; color: var(--tn-text-1); line-height: 1.4; }
.tn-h4 { font-size: 12px; font-weight: 600; color: var(--tn-text-1); line-height: 1.4; }

.tn-text-muted   { color: var(--tn-text-3); }
.tn-text-light   { color: var(--tn-text-4); }
.tn-text-accent  { color: var(--tn-accent); }
.tn-text-success { color: var(--tn-success); }
.tn-text-warning { color: var(--tn-warning); }
.tn-text-danger  { color: var(--tn-danger); }
.tn-text-mono    { font-family: var(--tn-font-mono); font-size: 11px; }
.tn-text-small   { font-size: 11px; }
.tn-text-xs      { font-size: 10px; }

.tn-link {
    color: var(--tn-accent);
    text-decoration: none;
    cursor: pointer;
}

.tn-link:hover { text-decoration: underline; }

.tn-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--tn-text-3);
}


/* =============================================================================
   4. CARD
   ============================================================================= */

.tn-card {
    background: var(--tn-bg-primary);
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    box-shadow: var(--tn-shadow-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

/* Left-border color accents */
.tn-card.card-blue   { border-left: 3px solid var(--tn-accent); }
.tn-card.card-green  { border-left: 3px solid var(--tn-success); }
.tn-card.card-orange { border-left: 3px solid var(--tn-warning); }
.tn-card.card-red    { border-left: 3px solid var(--tn-danger); }
.tn-card.card-cyan   { border-left: 3px solid var(--tn-info); }

.tn-card-head {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--tn-border);
    background: var(--tn-bg-tertiary);
}

.tn-card-head h4,
.tn-card-head .tn-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--tn-text-1);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.tn-card-head h4 i,
.tn-card-head .tn-card-title i {
    color: var(--tn-accent);
    font-size: 12px;
}

.tn-card-body {
    padding: 12px 16px;
}

.tn-card-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--tn-border-light);
    font-size: 10px;
    color: var(--tn-text-3);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--tn-bg-tertiary);
}

.tn-card-footer i { font-size: 9px; color: var(--tn-text-4); }


/* =============================================================================
   5. ROW (settings-style)
   ============================================================================= */

.tn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--tn-border-light);
    transition: background .1s;
    gap: 12px;
}

.tn-row:last-child { border-bottom: none; }
.tn-row:hover { background: var(--tn-bg-tertiary); }

.tn-row-info {
    flex: 1;
    min-width: 0;
}

.tn-row-label {
    font-size: 12px;
    color: var(--tn-text-1);
    font-weight: 500;
}

.tn-row-hint {
    font-size: 11px;
    color: var(--tn-text-3);
    margin-top: 1px;
}

.tn-row-ctrl {
    flex-shrink: 0;
    margin-left: 16px;
}


/* =============================================================================
   6. FORM
   ============================================================================= */

/* --- Form row (label + field stacked or side-by-side) --- */
.tn-form-row {
    display: flex;
    align-items: flex-start;
    padding: 10px 16px;
    border-bottom: 1px solid var(--tn-border-light);
    gap: 16px;
}

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

.tn-form-label {
    width: 160px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--tn-text-1);
    padding-top: 7px;
}

.tn-form-label .required {
    color: var(--tn-danger);
    margin-left: 2px;
}

.tn-form-label .label-hint {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: var(--tn-text-4);
    margin-top: 2px;
}

.tn-form-field {
    flex: 1;
    min-width: 0;
}

/* --- Input --- */
.tn-input {
    padding: 7px 12px;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    font-size: 12px;
    font-family: inherit;
    color: var(--tn-text-1);
    background: var(--tn-bg-primary);
    width: 100%;
    max-width: 320px;
    transition: all var(--tn-speed);
    outline: none;
}

.tn-input:focus {
    border-color: var(--tn-accent);
    box-shadow: 0 0 0 3px var(--tn-accent-bg);
}

.tn-input.error { border-color: var(--tn-danger); }
.tn-input:disabled { opacity: .5; cursor: not-allowed; background: var(--tn-bg-tertiary); }

.tn-input-sm { padding: 5px 10px; font-size: 11px; }
.tn-input-full { max-width: none; width: 100%; }

/* --- Select --- */
.tn-select {
    padding: 7px 30px 7px 12px;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    font-size: 12px;
    font-family: inherit;
    color: var(--tn-text-1);
    background: var(--tn-bg-primary);
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all var(--tn-speed);
    outline: none;
}

.tn-select:focus {
    border-color: var(--tn-accent);
    box-shadow: 0 0 0 3px var(--tn-accent-bg);
}

[data-theme="dark"] .tn-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E");
}

/* --- Textarea --- */
.tn-textarea {
    padding: 8px 12px;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    font-size: 12px;
    font-family: inherit;
    color: var(--tn-text-1);
    background: var(--tn-bg-primary);
    width: 100%;
    max-width: 420px;
    resize: vertical;
    min-height: 72px;
    outline: none;
    transition: border-color var(--tn-speed), box-shadow var(--tn-speed);
}

.tn-textarea:focus {
    border-color: var(--tn-accent);
    box-shadow: 0 0 0 3px var(--tn-accent-bg);
}

/* --- Inline group (ex: port + protocol) --- */
.tn-inline-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --- Checkbox / Radio group --- */
.tn-check-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tn-check-group.horizontal {
    flex-direction: row;
    gap: 16px;
    flex-wrap: wrap;
}

.tn-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--tn-text-2);
}

.tn-check-item input[type="checkbox"],
.tn-check-item input[type="radio"] {
    width: 14px;
    height: 14px;
    accent-color: var(--tn-accent);
    cursor: pointer;
    margin: 0;
}

.tn-check-item:hover { color: var(--tn-text-1); }

/* --- Help text --- */
.tn-help {
    font-size: 10px;
    color: var(--tn-text-3);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tn-help i { font-size: 9px; color: var(--tn-text-4); }

/* --- Error text --- */
.tn-error-text {
    font-size: 10px;
    color: var(--tn-danger);
    margin-top: 3px;
}


/* =============================================================================
   7. BUTTON
   ============================================================================= */

.tn-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--tn-radius-sm);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--tn-speed);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.3;
}

.tn-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

.tn-btn-primary {
    background: var(--tn-accent);
    color: #fff;
    border-color: var(--tn-accent);
}
.tn-btn-primary:hover { background: var(--tn-accent-dark); }

.tn-btn-secondary {
    background: var(--tn-bg-primary);
    color: var(--tn-text-2);
    border-color: var(--tn-border);
}
.tn-btn-secondary:hover { background: var(--tn-bg-hover); }

.tn-btn-danger {
    background: var(--tn-bg-primary);
    color: var(--tn-danger);
    border-color: var(--tn-border);
}
.tn-btn-danger:hover { background: var(--tn-danger-light); border-color: var(--tn-danger); }

.tn-btn-ghost {
    background: transparent;
    color: var(--tn-text-2);
    border-color: transparent;
}
.tn-btn-ghost:hover { background: var(--tn-bg-hover); }

.tn-btn-success {
    background: var(--tn-success);
    color: #fff;
    border-color: var(--tn-success);
}
.tn-btn-success:hover { filter: brightness(.9); }

.tn-btn-warning {
    background: var(--tn-bg-primary);
    color: var(--tn-warning);
    border-color: var(--tn-border);
}
.tn-btn-warning:hover { background: var(--tn-warning-light); border-color: var(--tn-warning); }

/* Sizes */
.tn-btn-xs  { padding: 3px 8px;  font-size: 10px; }
.tn-btn-sm  { padding: 4px 10px; font-size: 11px; }
.tn-btn-lg  { padding: 10px 20px; font-size: 13px; }

/* Icon-only button */
.tn-btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
}

.tn-btn-icon.sm { width: 26px; height: 26px; font-size: 11px; }
.tn-btn-icon.lg { width: 36px; height: 36px; font-size: 14px; }

/* Button bar (bottom of card) */
.tn-btn-bar {
    padding: 10px 16px;
    border-top: 1px solid var(--tn-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--tn-bg-tertiary);
}

.tn-btn-bar.spread { justify-content: space-between; }


/* =============================================================================
   8. TABLE
   ============================================================================= */

.tn-table {
    width: 100%;
    border-collapse: collapse;
}

.tn-table th {
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--tn-text-3);
    text-align: left;
    border-bottom: 1px solid var(--tn-border);
    background: var(--tn-bg-tertiary);
}

.tn-table td {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--tn-text-1);
    border-bottom: 1px solid var(--tn-border-light);
}

.tn-table tr:hover td { background: var(--tn-bg-tertiary); }
.tn-table tr:last-child td { border-bottom: none; }

.tn-table .mono {
    font-family: var(--tn-font-mono);
    font-size: 11px;
    color: var(--tn-text-3);
}

/* Sortable header */
.tn-table th.sortable { cursor: pointer; user-select: none; }
.tn-table th.sortable:hover { color: var(--tn-text-1); }
.tn-table th.sort-asc::after  { content: ' ▲'; font-size: 8px; }
.tn-table th.sort-desc::after { content: ' ▼'; font-size: 8px; }

/* Compact variant */
.tn-table.compact th { padding: 6px 10px; }
.tn-table.compact td { padding: 6px 10px; font-size: 11px; }

/* Striped variant */
.tn-table.striped tbody tr:nth-child(even) td {
    background: var(--tn-bg-tertiary);
}


/* =============================================================================
   9. LIST
   ============================================================================= */

.tn-list-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--tn-border-light);
    transition: background .1s;
    gap: 12px;
}

.tn-list-item:last-child { border-bottom: none; }
.tn-list-item:hover { background: var(--tn-bg-tertiary); }

.tn-list-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--tn-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.tn-list-icon.blue   { background: var(--tn-accent-light); color: var(--tn-accent); }
.tn-list-icon.green  { background: var(--tn-success-light); color: var(--tn-success); }
.tn-list-icon.orange { background: var(--tn-warning-light); color: var(--tn-warning); }
.tn-list-icon.red    { background: var(--tn-danger-light);  color: var(--tn-danger); }
.tn-list-icon.cyan   { background: var(--tn-info-light);    color: var(--tn-info); }

.tn-list-info {
    flex: 1;
    min-width: 0;
}

.tn-list-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--tn-text-1);
}

.tn-list-desc {
    font-size: 11px;
    color: var(--tn-text-3);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tn-list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Hover actions */
.tn-list-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--tn-speed);
}

.tn-list-item:hover .tn-list-actions { opacity: 1; }

.tn-list-action {
    width: 28px;
    height: 28px;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-sm);
    background: var(--tn-bg-primary);
    color: var(--tn-text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all .12s;
}

.tn-list-action:hover { background: var(--tn-bg-hover); color: var(--tn-text-1); }
.tn-list-action.danger:hover { color: var(--tn-danger); border-color: var(--tn-danger); background: var(--tn-danger-light); }


/* =============================================================================
   10. TOGGLE
   ============================================================================= */

.tn-toggle {
    width: 34px;
    height: 20px;
    border-radius: var(--tn-radius-full);
    background: var(--tn-border);
    position: relative;
    cursor: pointer;
    transition: background .18s;
    flex-shrink: 0;
}

.tn-toggle.on { background: var(--tn-accent); }

.tn-toggle::after {
    content: '';
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform .18s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.tn-toggle.on::after { transform: translateX(14px); }

/* Toggle with label (inline) */
.tn-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tn-toggle-label {
    font-size: 12px;
    color: var(--tn-text-2);
    cursor: pointer;
}

/* Colored variants */
.tn-toggle.success.on { background: var(--tn-success); }
.tn-toggle.danger.on  { background: var(--tn-danger); }
.tn-toggle.warning.on { background: var(--tn-warning); }


/* =============================================================================
   11. BADGE / PILL
   ============================================================================= */

.tn-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--tn-radius-full);
}

.tn-badge.on       { background: var(--tn-success-light); color: var(--tn-success); }
.tn-badge.off      { background: var(--tn-danger-light);  color: var(--tn-danger); }
.tn-badge.pending  { background: var(--tn-warning-light); color: var(--tn-warning); }
.tn-badge.info     { background: var(--tn-info-light);    color: var(--tn-info); }
.tn-badge.accent   { background: var(--tn-accent-light);  color: var(--tn-accent); }
.tn-badge.neutral  { background: var(--tn-bg-primary);    color: var(--tn-text-2); border: 1px solid var(--tn-border); }

.tn-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Pill (smaller, compact) */
.tn-pill {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--tn-radius-full);
    white-space: nowrap;
}

.tn-pill.on       { background: var(--tn-success-light); color: var(--tn-success); }
.tn-pill.off      { background: var(--tn-danger-light);  color: var(--tn-danger); }
.tn-pill.default  { background: var(--tn-accent-light);  color: var(--tn-accent); }
.tn-pill.neutral  { background: var(--tn-bg-tertiary);   color: var(--tn-text-3); }

/* Count badge (for sidebar, tabs, etc.) */
.tn-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--tn-radius-full);
    background: var(--tn-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
}

.tn-count.muted {
    background: var(--tn-bg-tertiary);
    color: var(--tn-text-3);
}


/* =============================================================================
   12. TABS
   ============================================================================= */

/* --- Horizontal tabs (underline style) --- */
.tn-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--tn-border);
}

.tn-tab {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: var(--tn-text-3);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--tn-speed);
    margin-bottom: -1px;
}

.tn-tab:hover { color: var(--tn-text-1); }

.tn-tab.active {
    color: var(--tn-accent);
    border-bottom-color: var(--tn-accent);
}

/* --- Scope switcher (button group) --- */
.tn-scope-group {
    display: flex;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-sm);
    overflow: hidden;
}

.tn-scope-btn {
    padding: 5px 12px;
    background: var(--tn-bg-primary);
    border: none;
    border-right: 1px solid var(--tn-border);
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    color: var(--tn-text-3);
    cursor: pointer;
    transition: all var(--tn-speed);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tn-scope-btn:last-child { border-right: none; }
.tn-scope-btn:hover { background: var(--tn-bg-tertiary); color: var(--tn-text-2); }
.tn-scope-btn.active { background: var(--tn-bg-selected); color: var(--tn-accent); }
.tn-scope-btn i { font-size: 10px; }

/* --- Pill tabs (like segment control) --- */
.tn-pill-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--tn-bg-tertiary);
    border-radius: var(--tn-radius-lg);
}

.tn-pill-tab {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    color: var(--tn-text-3);
    background: transparent;
    border: none;
    border-radius: var(--tn-radius);
    cursor: pointer;
    transition: all var(--tn-speed);
}

.tn-pill-tab:hover { color: var(--tn-text-1); }
.tn-pill-tab.active {
    background: var(--tn-bg-primary);
    color: var(--tn-accent);
    box-shadow: var(--tn-shadow-xs);
}


/* =============================================================================
   13. MODAL
   ============================================================================= */

.tn-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--tn-bg-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}

.tn-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.tn-modal {
    background: var(--tn-bg-primary);
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-lg);
    box-shadow: var(--tn-shadow-lg);
    width: 480px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(10px);
    transition: transform .2s;
}

.tn-modal-overlay.show .tn-modal {
    transform: translateY(0);
}

/* Sizes */
.tn-modal.sm { width: 360px; }
.tn-modal.lg { width: 640px; }
.tn-modal.xl { width: 840px; }

.tn-modal-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--tn-border);
    flex-shrink: 0;
}

.tn-modal-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--tn-text-1);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.tn-modal-header h3 i { color: var(--tn-accent); }

.tn-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--tn-text-3);
    cursor: pointer;
    border-radius: var(--tn-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--tn-speed);
}

.tn-modal-close:hover { background: var(--tn-bg-hover); color: var(--tn-text-1); }

.tn-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.tn-modal-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--tn-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    background: var(--tn-bg-tertiary);
}

.tn-modal-footer.spread { justify-content: space-between; }


/* =============================================================================
   14. TOAST
   ============================================================================= */

.tn-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.tn-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    min-width: 280px;
    max-width: 420px;
    border-radius: var(--tn-radius);
    box-shadow: var(--tn-shadow-md);
    font-size: 12px;
    font-weight: 500;
    pointer-events: auto;
    animation: tnToastIn .25s ease;
    border-left: 3px solid transparent;
}

.tn-toast.success {
    background: var(--tn-bg-primary);
    color: var(--tn-success);
    border-left-color: var(--tn-success);
}

.tn-toast.danger {
    background: var(--tn-bg-primary);
    color: var(--tn-danger);
    border-left-color: var(--tn-danger);
}

.tn-toast.warning {
    background: var(--tn-bg-primary);
    color: var(--tn-warning);
    border-left-color: var(--tn-warning);
}

.tn-toast.info {
    background: var(--tn-bg-primary);
    color: var(--tn-accent);
    border-left-color: var(--tn-accent);
}

.tn-toast i { font-size: 14px; flex-shrink: 0; }

.tn-toast-msg {
    flex: 1;
    color: var(--tn-text-1);
}

.tn-toast-close {
    background: none;
    border: none;
    color: var(--tn-text-4);
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    transition: color var(--tn-speed);
}

.tn-toast-close:hover { color: var(--tn-text-1); }

.tn-toast.fade-out { animation: tnToastOut .2s ease forwards; }


/* =============================================================================
   15. EMPTY STATE
   ============================================================================= */

.tn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 10px;
    color: var(--tn-text-4);
}

.tn-empty i {
    font-size: 36px;
    margin-bottom: 4px;
}

.tn-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tn-text-3);
}

.tn-empty-desc {
    font-size: 12px;
    color: var(--tn-text-4);
    text-align: center;
    max-width: 320px;
}


/* =============================================================================
   16. LOADER
   ============================================================================= */

/* Spinner */
.tn-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--tn-border);
    border-top-color: var(--tn-accent);
    border-radius: 50%;
    animation: tnSpin .6s linear infinite;
}

.tn-spinner.sm { width: 16px; height: 16px; border-width: 2px; }
.tn-spinner.lg { width: 36px; height: 36px; border-width: 3px; }

/* Centered loading state */
.tn-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 12px;
    color: var(--tn-text-3);
    font-size: 12px;
}

/* Skeleton line */
.tn-skeleton {
    background: var(--tn-bg-tertiary);
    border-radius: var(--tn-radius-sm);
    animation: tnPulse 1.5s ease-in-out infinite;
}

.tn-skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    width: 100%;
}

.tn-skeleton-line.w75 { width: 75%; }
.tn-skeleton-line.w50 { width: 50%; }
.tn-skeleton-line.w25 { width: 25%; }


/* =============================================================================
   16b. PROGRESS BAR
   ============================================================================= */

.tn-progress {
    height: 6px;
    background: var(--tn-bg-tertiary);
    border-radius: var(--tn-radius-full);
    overflow: hidden;
}

.tn-progress-bar {
    height: 100%;
    border-radius: var(--tn-radius-full);
    background: var(--tn-accent);
    transition: width .3s ease;
}

.tn-progress-bar.success { background: var(--tn-success); }
.tn-progress-bar.warning { background: var(--tn-warning); }
.tn-progress-bar.danger  { background: var(--tn-danger); }
.tn-progress-bar.info    { background: var(--tn-info); }

.tn-progress.lg { height: 8px; }


/* =============================================================================
   16c. CALLOUT (info/warning/danger notes)
   ============================================================================= */

.tn-callout {
    padding: 10px 14px;
    border-radius: var(--tn-radius);
    font-size: 12px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tn-callout i:first-child {
    margin-top: 2px;
    flex-shrink: 0;
}

.tn-callout.info {
    background: var(--tn-info-light);
    color: var(--tn-info);
    border: 1px solid rgba(6, 182, 212, .2);
}

.tn-callout.success {
    background: var(--tn-success-light);
    color: var(--tn-success);
    border: 1px solid rgba(34, 197, 94, .2);
}

.tn-callout.warning {
    background: var(--tn-warning-light);
    color: var(--tn-warning);
    border: 1px solid rgba(245, 158, 11, .2);
}

.tn-callout.danger {
    background: var(--tn-danger-light);
    color: var(--tn-danger);
    border: 1px solid rgba(239, 68, 68, .2);
}


/* =============================================================================
   17. SCROLLBAR
   ============================================================================= */

.tn-content::-webkit-scrollbar,
.tn-modal-body::-webkit-scrollbar {
    width: 4px;
}

.tn-content::-webkit-scrollbar-thumb,
.tn-modal-body::-webkit-scrollbar-thumb {
    background: var(--tn-border);
    border-radius: 2px;
}

.tn-content::-webkit-scrollbar-track,
.tn-modal-body::-webkit-scrollbar-track {
    background: transparent;
}


/* =============================================================================
   18. ANIMATIONS
   ============================================================================= */

@keyframes tnFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes tnFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

@keyframes tnSlideRight {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes tnToastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes tnToastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

@keyframes tnSpin {
    to { transform: rotate(360deg); }
}

@keyframes tnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* Animation utility classes */
.tn-anim-fade    { animation: tnFadeIn .2s ease; }
.tn-anim-slide   { animation: tnSlideRight .25s ease; }


/* =============================================================================
   19. UTILITIES
   ============================================================================= */

/* --- Spacing --- */
.tn-mt-0  { margin-top: 0; }
.tn-mt-1  { margin-top: 4px; }
.tn-mt-2  { margin-top: 8px; }
.tn-mt-3  { margin-top: 12px; }
.tn-mt-4  { margin-top: 16px; }
.tn-mt-5  { margin-top: 24px; }

.tn-mb-0  { margin-bottom: 0; }
.tn-mb-1  { margin-bottom: 4px; }
.tn-mb-2  { margin-bottom: 8px; }
.tn-mb-3  { margin-bottom: 12px; }
.tn-mb-4  { margin-bottom: 16px; }
.tn-mb-5  { margin-bottom: 24px; }

.tn-p-0   { padding: 0; }
.tn-p-1   { padding: 4px; }
.tn-p-2   { padding: 8px; }
.tn-p-3   { padding: 12px; }
.tn-p-4   { padding: 16px; }

.tn-gap-1 { gap: 4px; }
.tn-gap-2 { gap: 8px; }
.tn-gap-3 { gap: 12px; }
.tn-gap-4 { gap: 16px; }

/* --- Display --- */
.tn-flex       { display: flex; }
.tn-flex-col   { display: flex; flex-direction: column; }
.tn-flex-wrap  { flex-wrap: wrap; }
.tn-items-center { align-items: center; }
.tn-justify-between { justify-content: space-between; }
.tn-justify-end     { justify-content: flex-end; }
.tn-flex-1     { flex: 1; }
.tn-shrink-0   { flex-shrink: 0; }

/* --- Text --- */
.tn-text-left    { text-align: left; }
.tn-text-center  { text-align: center; }
.tn-text-right   { text-align: right; }
.tn-nowrap       { white-space: nowrap; }
.tn-truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-break-word   { word-break: break-word; }
.tn-font-bold    { font-weight: 600; }
.tn-font-normal  { font-weight: 400; }

/* --- Visibility --- */
.tn-hidden   { display: none !important; }
.tn-visible  { display: block; }
.tn-sr-only  {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* --- Border --- */
.tn-border     { border: 1px solid var(--tn-border); }
.tn-border-b   { border-bottom: 1px solid var(--tn-border); }
.tn-border-t   { border-top: 1px solid var(--tn-border); }
.tn-no-border  { border: none; }

/* --- Background --- */
.tn-bg-surface  { background: var(--tn-bg-primary); }
.tn-bg-muted    { background: var(--tn-bg-tertiary); }

/* --- Rounded --- */
.tn-rounded     { border-radius: var(--tn-radius); }
.tn-rounded-lg  { border-radius: var(--tn-radius-lg); }
.tn-rounded-full { border-radius: var(--tn-radius-full); }

/* --- Cursor --- */
.tn-pointer { cursor: pointer; }
.tn-not-allowed { cursor: not-allowed; }

/* --- Divider --- */
.tn-divider {
    height: 1px;
    background: var(--tn-border);
    margin: 12px 0;
    border: none;
}

/* --- Code block --- */
.tn-code {
    display: inline;
    padding: 2px 6px;
    background: var(--tn-bg-tertiary);
    border: 1px solid var(--tn-border-light);
    border-radius: 3px;
    font-family: var(--tn-font-mono);
    font-size: 11px;
    color: var(--tn-text-2);
}

.tn-pre {
    padding: 12px 16px;
    background: var(--tn-bg-tertiary);
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    font-family: var(--tn-font-mono);
    font-size: 11px;
    color: var(--tn-text-2);
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
}


@media (max-width: 800px) {
    .tn-pub-page-actions .tn-btn-primary {
        position: fixed;
        top: 60px;
        right: 12px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        padding: 0;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }
	.tn-pub-page-actions .tn-btn-primary i {
        padding-left: 0.5rem;
        font-size: 1.25rem; /* réaffiche l'icône */
    }
    
    .tn-pub-page-actions .tn-btn-primary span,
    .tn-pub-page-actions .tn-btn-primary .btn-text {
        display: none;
    }
}
/* =============================================================================
   20. BUTTON GROUP
   ============================================================================= */

.tn-btn-group {
    display: inline-flex;
}

.tn-btn-group .tn-btn {
    border-radius: 0;
}

.tn-btn-group .tn-btn:first-child {
    border-radius: var(--tn-radius) 0 0 var(--tn-radius);
}

.tn-btn-group .tn-btn:last-child {
    border-radius: 0 var(--tn-radius) var(--tn-radius) 0;
}

.tn-btn-group .tn-btn:not(:last-child) {
    border-right-width: 0;
}

.tn-btn-group .tn-btn.active {
    background: var(--tn-accent);
    border-color: var(--tn-accent);
    color: #fff;
    z-index: 1;
}


/* =============================================================================
   21. BUTTON OUTLINE VARIANTS
   ============================================================================= */

.tn-btn-outline-primary {
    background: transparent;
    border: 1px solid var(--tn-accent);
    color: var(--tn-accent);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--tn-radius);
    cursor: pointer;
    transition: all var(--tn-speed);
}

.tn-btn-outline-primary:hover {
    background: var(--tn-accent);
    color: #fff;
}

.tn-btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--tn-border);
    color: var(--tn-text-2);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--tn-radius);
    cursor: pointer;
    transition: all var(--tn-speed);
}

.tn-btn-outline-secondary:hover {
    background: var(--tn-bg-tertiary);
    color: var(--tn-text-1);
}


/* =============================================================================
   22. BACK BUTTON
   ============================================================================= */

.tn-btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--tn-radius);
    color: var(--tn-text-2);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--tn-speed);
}

.tn-btn-back:hover {
    background: var(--tn-bg-tertiary);
    color: var(--tn-text-1);
}


/* =============================================================================
   23. DROPDOWN
   ============================================================================= */

.tn-dropdown {
    position: relative;
    display: inline-block;
}

.tn-dropdown-toggle {
    cursor: pointer;
}

.tn-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    background: var(--tn-bg-primary);
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    box-shadow: var(--tn-shadow-lg);
    z-index: 1000;
    display: none;
    padding: 4px 0;
}

.tn-dropdown-menu.left {
    right: auto;
    left: 0;
}

.tn-dropdown.open .tn-dropdown-menu,
.tn-dropdown-menu.show {
    display: block;
}

.tn-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--tn-text-1);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--tn-speed);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.tn-dropdown-item:hover {
    background: var(--tn-bg-tertiary);
}

.tn-dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--tn-text-3);
    flex-shrink: 0;
}

.tn-dropdown-item.danger {
    color: var(--tn-danger);
}

.tn-dropdown-item.danger i {
    color: var(--tn-danger);
}

.tn-dropdown-divider {
    height: 1px;
    background: var(--tn-border-light);
    margin: 4px 0;
}


/* =============================================================================
   24. DROPZONE
   ============================================================================= */

.tn-dropzone {
    border: 2px dashed var(--tn-border);
    border-radius: var(--tn-radius);
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--tn-speed);
    background: var(--tn-bg-primary);
}

.tn-dropzone:hover,
.tn-dropzone.dragover {
    border-color: var(--tn-accent);
    background: var(--tn-accent-bg);
}

.tn-dropzone-icon {
    font-size: 32px;
    color: var(--tn-text-3);
    margin-bottom: 8px;
}

.tn-dropzone.dragover .tn-dropzone-icon {
    color: var(--tn-accent);
}

.tn-dropzone-text {
    margin: 0;
    font-size: 13px;
    color: var(--tn-text-2);
}

.tn-dropzone-browse {
    color: var(--tn-accent);
    text-decoration: underline;
    cursor: pointer;
}

.tn-dropzone-browse:hover {
    color: var(--tn-accent-dark);
}

.tn-dropzone-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--tn-bg-tertiary);
    border-radius: var(--tn-radius);
    margin-top: 12px;
}

.tn-dropzone-file i {
    color: var(--tn-accent);
}

.tn-dropzone-file span {
    flex: 1;
    font-size: 13px;
    color: var(--tn-text-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =============================================================================
   25. STAT CARD
   ============================================================================= */

.tn-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tn-stat-card {
    background: var(--tn-bg-primary);
    border: 1px solid var(--tn-border-light);
    border-radius: var(--tn-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tn-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--tn-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.tn-stat-icon.primary {
    background: var(--tn-accent-bg);
    color: var(--tn-accent);
}

.tn-stat-icon.success {
    background: var(--tn-success-light);
    color: var(--tn-success);
}

.tn-stat-icon.warning {
    background: var(--tn-warning-light);
    color: var(--tn-warning);
}

.tn-stat-icon.danger {
    background: var(--tn-danger-light);
    color: var(--tn-danger);
}

.tn-stat-icon.info {
    background: var(--tn-info-light);
    color: var(--tn-info);
}

.tn-stat-content {
    flex: 1;
    min-width: 0;
}

.tn-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--tn-text-1);
    line-height: 1.2;
}

.tn-stat-label {
    font-size: 12px;
    color: var(--tn-text-3);
    margin-top: 2px;
}


/* =============================================================================
   FIN — TELANODE DESIGN SYSTEM
   ============================================================================= */
