﻿/* 
   TodoQuick Web  Feuille de styles principale
   Palette fidle au projet WPF :
     Background : #F5F7FB   Surface : #FFFFFF   Sidebar : #F1F5F9
     Accent     : #2563EB   Success : #16A34A   Danger  : #DC2626
     Text       : #101828   Muted   : #64748B   Stroke  : #D9E0EA
    */

/*  Reset & base  */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #F5F7FB;
    --surface:     #FFFFFF;
    --surface-alt: #F8FAFC;
    --sidebar:     #F1F5F9;
    --stroke:      #D9E0EA;
    --text:        #101828;
    --text-strong: #0F172A;
    --muted:       #64748B;
    --accent:      #2563EB;
    --accent-soft: #E8F0FF;
    --success:     #16A34A;
    --success-soft:#DCFCE7;
    --danger:      #DC2626;
    --danger-soft: #FEE2E2;
    --hover:       #EEF4FF;
    --row-hover:   #F3F7FF;
    --row-sel:     #DCEBFF;
    --row-sel-br:  #7FB0FF;
    --radius-sm:   10px;
    --radius-md:   16px;
    --radius-lg:   24px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:   0 4px 16px rgba(37,99,235,.08), 0 1px 4px rgba(0,0,0,.06);
    --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
    --topbar-h:    52px;
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/*  Topbar  */
.tq-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--stroke);
    display: flex; align-items: center;
    padding: 0 20px;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}
.tq-topbar-brand {
    display: flex; align-items: center; gap: 9px;
    font-weight: 700; font-size: 15px; color: var(--accent);
    flex: 1;
}
.tq-logo-icon { display: flex; align-items: center; }
.tq-topbar-actions { display: flex; align-items: center; gap: 4px; }

.tq-nav-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; color: var(--muted);
    text-decoration: none; border: none; background: none; cursor: pointer;
    transition: background .15s, color .15s;
}
.tq-nav-link:hover, .tq-nav-link.active { background: var(--accent-soft); color: var(--accent); }
.tq-nav-logout { color: var(--muted); }
.tq-nav-logout:hover { background: var(--danger-soft); color: var(--danger); }

/*  Board switch (multi-board)  */
.tq-board-switch {
    position: relative;
}
.tq-board-switch-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px 5px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--stroke);
    background: var(--surface-alt);
    font-size: 13px; font-weight: 500; color: var(--text);
    cursor: pointer; transition: background .15s, border-color .15s;
    white-space: nowrap; max-width: 200px;
}
.tq-board-switch-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tq-board-switch-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px;
}
.tq-board-switch-menu {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0;
    min-width: 200px; max-width: 260px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 200;
    padding: 6px;
    overflow: hidden;
}
.tq-board-switch-menu--open { display: block; }
.tq-board-switch-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; color: var(--text);
    border: none; background: none; cursor: pointer; text-align: left;
    transition: background .12s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tq-board-switch-item:hover { background: var(--hover); }
.tq-board-switch-item--current {
    color: var(--accent); background: var(--accent-soft); cursor: default;
    font-weight: 600;
}
.tq-board-switch-form { display: contents; }

/*  Page wrap  */
.tq-page-wrap { min-height: 100vh; }
.tq-page-wrap.has-topbar { padding-top: var(--topbar-h); }

/*  Flash banners  */
.tq-flash {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; font-size: 13px; font-weight: 500;
    border-radius: var(--radius-sm); margin: 12px 20px 0;
}
.tq-flash-success { background: #ECFDF5; color: #166534; border: 1px solid #BBF7D0; }
.tq-flash-danger  { background: var(--danger-soft); color: var(--danger); border: 1px solid #FECACA; }

/* 
   AUTH PAGES
    */
.tq-auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #EFF6FF 0%, var(--bg) 60%);
    padding: 20px;
}
.tq-auth-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-md);
}
.tq-auth-logo {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 24px; justify-content: center;
}
.tq-auth-logo-icon {
    width: 52px; height: 52px;
    background: var(--accent);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.tq-auth-logo-text { font-size: 22px; font-weight: 700; color: var(--accent); }
.tq-auth-title    { font-size: 20px; font-weight: 700; text-align: center; color: var(--text-strong); margin-bottom: 6px; }
.tq-auth-subtitle { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; }
.tq-auth-form     { display: flex; flex-direction: column; gap: 16px; }
.tq-auth-footer   { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.tq-auth-footer a { color: var(--accent); font-weight: 500; text-decoration: none; }
.tq-auth-footer a:hover { text-decoration: underline; }

.tq-field-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--muted);
}
.tq-field-check input { accent-color: var(--accent); }

.tq-validation-summary {
    background: var(--danger-soft); color: var(--danger);
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm); padding: 10px 14px;
    font-size: 13px;
}
.tq-validation-summary ul { padding-left: 16px; margin: 0; }

/* 
   APP LAYOUT  (sidebar + main  calqu sur la fentre WPF)
    */
.tq-app {
    display: flex; flex-direction: column;
    min-height: calc(100vh - var(--topbar-h));
    padding: 18px;
    gap: 12px;
}
.tq-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 18px;
    flex: 1;
    min-height: 0;
}

/*  Bannire sync  */
.tq-sync-banner {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: #ECFDF5; color: #166534;
    border: 1px solid #BBF7D0;
    border-radius: 14px;
    font-size: 13px; font-weight: 500;
    animation: tq-fade-in .2s ease;
}

/* 
   SIDEBAR
    */
.tq-sidebar {
    background: var(--sidebar);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    display: flex; flex-direction: column; gap: 16px;
    overflow: hidden;
}
.tq-sidebar-brand {
    display: flex; justify-content: center;
    padding-bottom: 4px;
}
.tq-brand-icon {
    width: 60px; height: 60px;
    background: var(--surface);
    border: 1px solid #D9E3F3;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
}

/* Mtriques */
.tq-metrics {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.tq-metric-card {
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.tq-metric-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tq-metric-value { font-size: 26px; font-weight: 700; color: var(--text-strong); margin-top: 6px; line-height: 1; }

/* Liste des sections */
.tq-section-list-wrap { flex: 1; overflow-y: auto; min-height: 0; }
.tq-section-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.tq-section-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--stroke);
    transition: border-color .15s, box-shadow .15s;
}
.tq-section-item:hover { border-color: #BDD0F5; box-shadow: var(--shadow-sm); }
.tq-section-item.active { border-color: var(--accent); background: var(--accent-soft); }

.tq-section-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 12px 10px;
    background: none; border: none; cursor: pointer; text-align: left;
    color: var(--text);
}
.tq-section-info { flex: 1; min-width: 0; }
.tq-section-name {
    font-weight: 600; font-size: 13px; color: var(--text-strong);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tq-section-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.tq-section-pct  { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* Avatar/badge */
.tq-section-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    font-weight: 700; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tq-avatar-lg { width: 48px; height: 48px; font-size: 18px; border-radius: 14px; }

/* Boutons d'action dans la sidebar (rename/delete) */
.tq-section-actions {
    display: none; position: absolute;
    right: 6px; top: 50%; transform: translateY(-50%);
    gap: 2px; align-items: center;
    background: var(--surface); border-radius: 8px;
    padding: 2px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--stroke);
}
.tq-section-item:hover .tq-section-actions,
.tq-section-item.active .tq-section-actions { display: flex; }

/* Pied de sidebar */
.tq-sidebar-footer { flex-shrink: 0; }

/* 
   MAIN CARD
    */
.tq-main { min-width: 0; }
.tq-main-card {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex; flex-direction: column; gap: 18px;
    height: 100%; min-height: 500px;
}

/* En-tte section */
.tq-main-header {
    display: flex; align-items: center; gap: 16px;
    flex-wrap: wrap; justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--stroke);
}
.tq-main-header-left  { display: flex; align-items: center; gap: 14px; }
.tq-main-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tq-main-title { font-size: 18px; font-weight: 700; color: var(--text-strong); }

.tq-progress-bar-wrap { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tq-progress-bar {
    width: 120px; height: 5px;
    background: var(--stroke); border-radius: 99px; overflow: hidden;
}
.tq-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .4s ease, background .4s ease;
    /* La couleur est appliquee dynamiquement via JS selon le % */
    background: #DC2626;
}
.tq-progress-label { font-size: 11px; font-weight: 600; color: var(--muted); }

/* Badges statut */
.tq-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 99px;
    font-size: 12px; font-weight: 600;
}
.tq-badge-soft    { background: var(--accent-soft); color: var(--accent); }
.tq-badge-success { background: var(--success-soft); color: var(--success); }
.tq-badge-muted   { background: var(--surface-alt); color: var(--muted); border: 1px solid var(--stroke); }
.tq-badge-accent  { background: var(--accent); color: #fff; }

/* Barre d'ajout */
.tq-add-bar {
    display: flex; gap: 10px;
}
.tq-add-input { flex: 1; }

/* 
   TCHES  ARBRE
    */
.tq-task-area {
    flex: 1; overflow-y: auto; min-height: 0;
}

.tq-task-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }

/* Sous-niveau : indentation */
.tq-children { padding-left: 28px; margin-top: 2px; }
.tq-children.collapsed { display: none; }

.tq-task-item { border-radius: var(--radius-md); }
.tq-task-item.sortable-ghost { opacity: .4; background: var(--accent-soft); }
.tq-task-item.sortable-chosen { background: var(--row-hover); }

.tq-task-row {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    background: transparent;
    transition: background .12s, border-color .12s;
    position: relative;
}
.tq-task-row:hover { background: var(--row-hover); }
.tq-task-item.selected > .tq-task-row {
    background: var(--row-sel);
    border-color: var(--row-sel-br);
}

/* Drag handle */
.tq-drag-handle {
    cursor: grab; flex-shrink: 0; display: flex; align-items: center;
    padding: 2px; color: var(--muted);
    opacity: .5; transition: opacity .15s;
}
.tq-task-row:hover .tq-drag-handle { opacity: 1; }
.tq-drag-handle:active { cursor: grabbing; }

/* Checkbox */
.tq-checkbox-wrap {
    flex-shrink: 0; display: flex; align-items: center;
    cursor: pointer;
}
.tq-checkbox-input { display: none; }
.tq-checkbox-box {
    width: 20px; height: 20px;
    border-radius: 6px;
    border: 2px solid var(--stroke);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}
.tq-checkbox-input:checked + .tq-checkbox-box {
    background: var(--success);
    border-color: var(--success);
}
.tq-checkbox-input:checked + .tq-checkbox-box::after {
    content: '';
    display: block;
    width: 11px; height: 7px;
    border-left: 2.2px solid #fff;
    border-bottom: 2.2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}
.tq-checkbox-box-parent { border-style: dashed; opacity: .5; cursor: default; }

/* Titre de tche */
.tq-task-title {
    flex: 1; font-size: 13.5px; color: var(--text-strong);
    min-width: 0; word-break: break-word; cursor: pointer;
    transition: color .15s;
}
.tq-task-item.is-done > .tq-task-row .tq-task-title {
    text-decoration: line-through; color: var(--muted);
}

/* Compteur d'enfants */
.tq-child-count {
    font-size: 11px; font-weight: 600; color: var(--muted);
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: 99px; padding: 1px 8px;
    flex-shrink: 0;
}

/* Boutons d'action par ligne */
.tq-row-actions {
    display: none; align-items: center; gap: 2px;
    flex-shrink: 0;
}
.tq-task-row:hover .tq-row-actions,
.tq-task-item.selected > .tq-task-row .tq-row-actions { display: flex; }

/* Empty state */
.tq-empty-state {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 60px 20px;
    color: var(--muted); font-size: 14px;
}

/* 
   BOUTONS
    */
.tq-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 13.5px; font-weight: 600;
    border: none; cursor: pointer;
    transition: opacity .15s, background .15s;
    text-decoration: none; white-space: nowrap;
    line-height: 1.2;
}
.tq-btn:disabled { opacity: .55; cursor: default; }
.tq-btn-full  { width: 100%; }
.tq-btn-sm    { padding: 5px 12px; font-size: 12px; }

.tq-btn-primary   { background: var(--accent); color: #fff; }
.tq-btn-primary:hover:not(:disabled) { opacity: .9; }
.tq-btn-primary:active:not(:disabled) { opacity: .8; }

.tq-btn-secondary {
    background: var(--surface); color: var(--text-strong);
    border: 1px solid var(--stroke);
}
.tq-btn-secondary:hover:not(:disabled) { background: var(--surface-alt); border-color: #B7C3D4; }

.tq-btn-danger { background: var(--danger); color: #fff; }
.tq-btn-danger:hover:not(:disabled) { opacity: .9; }

/* Icon button */
.tq-icon-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    border-radius: 8px; color: var(--muted);
    transition: background .12s, color .12s;
}
.tq-icon-btn:hover { background: var(--hover); color: var(--accent); }
.tq-icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* 
   CHAMPS DE FORMULAIRE
    */
.tq-field { display: flex; flex-direction: column; gap: 5px; }
.tq-label { font-size: 13px; font-weight: 500; color: var(--text-strong); }
.tq-field-error { font-size: 12px; color: var(--danger); }

.tq-input {
    width: 100%;
    padding: 9px 14px;
    font-family: var(--font); font-size: 13.5px; color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--stroke);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s;
}
.tq-input::placeholder { color: #A8B9CC; }
.tq-input:hover  { border-color: #B8C7DA; }
.tq-input:focus  { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* 
   MODALES
    */
.tq-modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(15,23,42,.4);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: tq-fade-in .15s ease;
}
.tq-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    width: 100%; max-width: 460px;
    animation: tq-slide-up .2s ease;
}
.tq-modal-sm { max-width: 380px; }
.tq-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--stroke);
}
.tq-modal-title  { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.tq-modal-close  { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.tq-modal-close:hover { background: var(--surface-alt); color: var(--text); }
.tq-modal-body   { padding: 20px 24px; }
.tq-modal-body p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.tq-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--stroke);
}

/* 
   ADMIN
    */
.tq-admin-wrap   { padding: 24px; max-width: 900px; margin: 0 auto; }
.tq-admin-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.tq-admin-title  {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 700; color: var(--text-strong);
}
.tq-card {
    background: var(--surface); border: 1px solid var(--stroke);
    border-radius: var(--radius-lg); overflow: hidden;
    padding : 15px;
}
.tq-table { width: 100%; border-collapse: collapse; }
.tq-table th {
    padding: 12px 16px; text-align: left;
    font-size: 12px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em;
    background: var(--surface-alt); border-bottom: 1px solid var(--stroke);
}
.tq-table td {
    padding: 14px 16px; border-bottom: 1px solid var(--stroke);
    vertical-align: middle;
}
.tq-table tr:last-child td { border-bottom: none; }
.tq-table tr:hover td { background: var(--row-hover); }

.tq-user-cell   { display: flex; align-items: center; gap: 12px; }
.tq-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tq-user-email { font-weight: 500; color: var(--text-strong); }

/* 
   ANIMATIONS
    */
@keyframes tq-fade-in {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes tq-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tq-flash-new {
    0%   { background: #EEF5FF; border-color: #B9D4FF; }
    100% { background: transparent; border-color: transparent; }
}
.tq-task-item.flash-new > .tq-task-row {
    animation: tq-flash-new 1.2s ease forwards;
}

/* ================================================================
   TOOLBAR  (recherche + filtres)
   ================================================================ */
.tq-toolbar {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; padding-bottom: 10px;
    border-bottom: 1px solid var(--stroke);
}
.tq-toolbar-search  { position: relative; flex: 1; min-width: 160px; }
.tq-search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--muted); pointer-events: none;
}
.tq-search-input  { padding-left: 32px !important; padding-right: 28px !important; }
.tq-search-clear  {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 14px; padding: 2px 4px;
    border-radius: 4px; line-height: 1;
}
.tq-search-clear:hover { color: var(--text); background: var(--surface-alt); }
.tq-toolbar-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tq-filter-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 12px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 500; color: var(--muted);
    background: var(--surface-alt); border: 1px solid var(--stroke);
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap; min-height: 36px;
}
.tq-filter-btn:hover { background: var(--hover); color: var(--accent); border-color: var(--accent); }
.tq-filter-btn[data-active="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tq-filter-select {
    padding: 7px 10px; border-radius: var(--radius-sm);
    font-size: 12px; color: var(--text);
    background: var(--surface-alt); border: 1px solid var(--stroke);
    cursor: pointer; min-height: 36px;
}

/* ── Dates d'écheance ── */
.tq-task-due {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 500;
    padding: 2px 7px; border-radius: 99px;
    background: #EFF6FF; color: #2563EB;
    border: 1px solid #BFDBFE; flex-shrink: 0;
}
.tq-task-due--overdue {
    background: #FEF2F2; color: #DC2626; border-color: #FECACA;
    animation: tq-pulse-danger 1.5s ease infinite;
}
@keyframes tq-pulse-danger { 0%,100% { opacity:1; } 50% { opacity:.65; } }

/* ── Bouton hamburger (caché > 900px) ── */
.tq-sidebar-toggle {
    display: none; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-shrink: 0;
    border: 1px solid var(--stroke); background: var(--surface-alt);
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
}

/* ── Overlay sidebar mobile ── */
.tq-sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 149; background: rgba(15,23,42,.4); backdrop-filter: blur(2px); }
.tq-sidebar-overlay--visible { display: block; }

/* ================================================================
   TABLETTE  (≤ 900px)
   ================================================================ */
@media (max-width: 900px) {
    .tq-layout { grid-template-columns: 1fr; }

    /* Sidebar = drawer latéral */
    .tq-sidebar {
        position: fixed;
        top: var(--topbar-h); left: 0; bottom: 0;
        width: 280px; z-index: 150;
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        border-left: none;
        transform: translateX(-100%);
        transition: transform .25s ease;
        overflow-y: auto;
        box-shadow: 4px 0 24px rgba(0,0,0,.14);
    }
    .tq-sidebar--open { transform: translateX(0); }
    .tq-sidebar-brand { display: flex; }
    .tq-sidebar-toggle { display: flex; }
    .tq-main-card { min-height: 400px; }
    .tq-progress-bar { width: 80px; }
}

/* ================================================================
   MOBILE  (≤ 600px)
   ================================================================ */
@media (max-width: 600px) {
    .tq-app { padding: 8px; gap: 8px; }
    .tq-main-card { padding: 12px; gap: 12px; }

    /* Header section */
    .tq-main-header { flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 12px; }
    .tq-main-header-left  { gap: 10px; }
    .tq-main-header-right { display: flex; flex-wrap: wrap; gap: 6px; }

    .tq-add-bar { flex-direction: column; }

    /* Toolbar scroll horizontal */
    .tq-toolbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; gap: 6px; }
    .tq-toolbar-search { min-width: 120px; }
    .tq-filter-btn { padding: 6px 10px; font-size: 11px; min-height: 40px; }
    .tq-filter-select { font-size: 11px; padding: 6px 8px; min-height: 40px; }

    /* Tâches : zones tactiles agrandies */
    .tq-task-row { padding: 11px 8px; }
    .tq-checkbox-box { width: 24px; height: 24px; border-radius: 8px; }
    .tq-icon-btn { width: 36px; height: 36px; }
    .tq-task-title { font-size: 14px; }
    .tq-row-actions { display: flex; }      /* toujours visible, pas de hover */
    .tq-section-actions { display: flex; }

    .tq-metrics { grid-template-columns: 1fr 1fr; }
    .tq-metric-value { font-size: 22px; }

    .tq-nav-link span { display: none; }
    .tq-nav-link { padding: 6px 8px; }
    .tq-topbar { padding: 0 10px; gap: 6px; }
    .tq-auth-card { padding: 24px 16px; }

    /* Modales : slide-up depuis le bas */
    .tq-modal-overlay { padding: 0; align-items: flex-end; }
    .tq-modal {
        max-width: 100%; width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh; overflow-y: auto;
    }

    .tq-board-switch-name { max-width: 80px; }
}

/* ================================================================
   TOUCH  (devices tactiles) : anti-zoom iOS + tap targets 44px
   ================================================================ */
@media (hover: none) and (pointer: coarse) {
    /* Empêche iOS de zoomer sur le focus d'un input < 16px */
    input, select, textarea { font-size: 16px !important; }

    /* Touch targets minimum 44×44 px (WCAG 2.5.8) */
    .tq-icon-btn     { width: 44px; height: 44px; }
    .tq-filter-btn   { min-height: 44px; }
    .tq-filter-select { min-height: 44px; }
    .tq-checkbox-box { width: 26px; height: 26px; }
    .tq-btn          { min-height: 44px; }
    .tq-nav-link     { min-height: 44px; }

    /* Toujours afficher les boutons d'action (pas de hover sur mobile) */
    .tq-row-actions     { display: flex !important; }
    .tq-section-actions { display: flex !important; }
}


/* Empecher le drag de se declencher sur les elements interactifs */
.tq-task-row .tq-checkbox-wrap,
.tq-task-row .tq-row-actions,
.tq-task-row input,
.tq-task-row button,
.tq-task-row label {
    cursor: default;
}


/* Ligne bleue AVANT l element cible */
.tq-task-item.tq-drop-before {
    position: relative;
}
.tq-task-item.tq-drop-before::before {
    content: '';
    display: block;
    position: absolute;
    top: -2px;
    left: 8px;
    right: 8px;
    height: 3px;
    background: var(--accent);
    border-radius: 99px;
    z-index: 10;
    box-shadow: 0 0 6px rgba(37,99,235,.5);
}
/* Petit cercle au debut de la ligne */
.tq-task-item.tq-drop-before::after {
    content: '';
    display: block;
    position: absolute;
    top: -5px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    z-index: 11;
}

/* Drag sur toute la ligne */
.tq-task-row {
    cursor: grab;
    user-select: none;
}
.tq-task-row:active { cursor: grabbing; }

/* Empecher le drag sur les elements interactifs */
.tq-task-row input,
.tq-task-row button,
.tq-task-row label,
.tq-task-row .tq-checkbox-wrap,
.tq-task-row .tq-row-actions {
    cursor: default;
}


/* Element en cours de deplacement */
.tq-task-item.tq-chosen > .tq-task-row {
    background: var(--accent-soft);
    border-radius: var(--radius-md);
}
.tq-task-item.tq-dragging {
    opacity: 0.5;
}

/* Fantome (placeholder a la position originale) */
.tq-task-item.tq-ghost > .tq-task-row {
    background: var(--accent-soft) !important;
    border: 2px dashed var(--accent) !important;
    border-radius: var(--radius-md);
    opacity: 0.55;
}
.tq-task-item.tq-ghost .tq-task-title,
.tq-task-item.tq-ghost .tq-row-actions { visibility: hidden; }

/* Trait bleu indicateur de position de depot */
.tq-drop-indicator {
    height: 3px;
    background: var(--accent);
    border-radius: 99px;
    margin: 2px 8px;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(37,99,235,.5);
    animation: tq-indicator-pop .15s ease;
}
@keyframes tq-indicator-pop {
    from { opacity: 0; transform: scaleX(.7); }
    to   { opacity: 1; transform: scaleX(1); }
}

/* Curseur global pendant le drag */
body.tq-is-dragging * { cursor: grabbing !important; }

/* Elements interactifs : ne pas etre handles de drag */
.tq-task-row input,
.tq-task-row button,
.tq-task-row label,
.tq-task-row .tq-checkbox-wrap,
.tq-task-row .tq-row-actions { cursor: default; }

/* Section sortable */
.tq-section-item.tq-ghost { opacity: 0.5; border: 2px dashed var(--accent); }
.tq-section-item.tq-chosen { box-shadow: var(--shadow-md); }

/*  Scrollbar discrte  */


/* ================================================================
   BOUTON PLIER / DEPLIER (fleche avant les taches avec enfants)
================================================================ */
.tq-toggle-btn {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer !important;
    border-radius: 6px;
    color: var(--muted);
    padding: 0;
    transition: background .12s, color .12s;
    /* IMPORTANT : visible meme dans .tq-task-row */
    visibility: visible !important;
    opacity: 1 !important;
}
.tq-toggle-btn:hover {
    background: var(--hover);
    color: var(--accent);
}
.tq-toggle-icon {
    display: block;
    transition: transform .2s ease;
    pointer-events: none;
}
.tq-toggle-placeholder {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* ================================================================
   SELECTION PAR CLAVIER / CLIC
================================================================ */
.tq-task-item { outline: none; }
.tq-task-item:focus > .tq-task-row {
    outline: 2px solid rgba(37,99,235,.4);
    outline-offset: 1px;
    border-radius: var(--radius-md);
}
.tq-task-item.tq-selected > .tq-task-row {
    background: var(--row-sel) !important;
    border-color: var(--row-sel-br) !important;
}

/* ================================================================
   DRAG & DROP
================================================================ */

/* Drag sur toute la ligne */
.tq-task-row {
    cursor: grab;
}
.tq-task-row:active {
    cursor: grabbing;
}
/* Pas de grab sur les elements interactifs */
.tq-task-row input,
.tq-task-row label,
.tq-task-row .tq-checkbox-wrap,
.tq-task-row .tq-row-actions,
.tq-task-row .tq-child-count {
    cursor: default;
}
/* Le toggle-btn garde son propre curseur pointer */
.tq-task-row .tq-toggle-btn {
    cursor: pointer !important;
}

/* Fantome (placeholder a la place de l element deplace) */
li.tq-task-item.tq-ghost > .tq-task-row {
    opacity: 0.25;
    background: var(--accent-soft) !important;
    border: 2px dashed var(--accent) !important;
    border-radius: var(--radius-md);
}
/* Element en cours de deplacement (suit le curseur) */
li.tq-task-item.tq-dragging {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(37,99,235,.25), 0 2px 8px rgba(0,0,0,.1);
    border: 1.5px solid var(--accent);
    opacity: .97;
}
/* Survol avant drop */
li.tq-task-item.tq-chosen > .tq-task-row {
    background: var(--hover);
    border-radius: var(--radius-md);
}

/* Indicateur de position : ligne bleue + cercle */
li.tq-task-item.tq-drop-here {
    position: relative;
}
li.tq-task-item.tq-drop-here::before {
    content: '';
    display: block;
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 99px;
    z-index: 20;
    box-shadow: 0 0 8px rgba(37,99,235,.5);
    pointer-events: none;
}
li.tq-task-item.tq-drop-here::after {
    content: '';
    display: block;
    position: absolute;
    top: -6px;
    left: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    z-index: 21;
    pointer-events: none;
}

/* ================================================================
   TACHES COCHEES
================================================================ */
.tq-done-title {
    text-decoration: line-through;
    color: var(--muted) !important;
    opacity: .75;
}
.tq-cb-parent-done {
    background: var(--muted) !important;
    border-color: var(--muted) !important;
    opacity: .55;
}

/* ================================================================
   DOUBLE-CLIC SUR TITRE
================================================================ */
.tq-task-title {
    cursor: pointer;
}
.tq-task-title:hover {
    color: var(--accent);
}
.tq-task-item.is-done .tq-task-title:hover {
    color: var(--muted);
}

/* ================================================================
   SCROLLBAR
================================================================ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* Wrapper interne : toggle (hors drag) + row (draggable) */
.tq-task-item-inner {
    display: flex;
    align-items: center;
    gap: 0;
}
.tq-task-item-inner > .tq-task-row {
    flex: 1;
    min-width: 0;
}
/* Le toggle-btn est hors de .tq-task-row donc hors du handle SortableJS */
.tq-task-item-inner > .tq-toggle-btn,
.tq-task-item-inner > .tq-toggle-placeholder {
    flex-shrink: 0;
}

/* ================================================================
   PICKER D EMOJI
================================================================ */
.tq-emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    padding: 10px;
    background: var(--surface-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    max-height: 120px;
    overflow-y: auto;
}
.tq-emoji-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--surface);
    border: 1.5px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .1s;
    padding: 0;
    line-height: 1;
}
.tq-emoji-btn:hover {
    background: var(--hover);
    border-color: var(--accent);
    transform: scale(1.15);
}
.tq-emoji-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: scale(1.1);
}

.tq-task-comment-indicator{
    display:inline-flex;
    align-items:center;
    gap:6px;
    margin-left:10px;
    padding:4px 8px;
    border-radius:999px;
    background:#EFF6FF;
    border:1px solid #BFDBFE;
    color:#1D4ED8;
    font-size:12px;
    font-weight:700;
    opacity:1;
    box-shadow:0 1px 2px rgba(37,99,235,.12);
}
.tq-task-comment-indicator-icon{
    font-size:15px;
    line-height:1;
}
.tq-task-comment-indicator-label{
    line-height:1;
    letter-spacing:.01em;
}
.task-flag,
.tq-task-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border-radius: 9999px !important;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

    .task-flag *,
    .tq-task-flag * {
        border-radius: 9999px !important;
    }

.tq-task-row .task-flag,
.tq-task-row .tq-task-flag {
    white-space: nowrap;
    border-radius: 9999px !important;
}
#modal-task-comment{
    min-height:120px;
    resize:vertical;
}
.tq-alert{
    padding:12px 14px;
    border-radius:12px;
    margin-bottom:16px;
    font-size:14px;
    border:1px solid transparent;
}
.tq-alert-success{background:#ECFDF5;border-color:#A7F3D0;color:#065F46;}
.tq-alert-error{background:#FEF2F2;border-color:#FECACA;color:#991B1B;}


/* ── Board label in sidebar ── */
.tq-sidebar-brand { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 16px 8px; }
.tq-board-label { display: flex; align-items: center; padding: 4px 10px; background: var(--accent-soft); border-radius: 20px; max-width: 100%; }
.tq-board-label-text { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

/* ── Comment button on tasks ── */
.tq-task-comment-indicator.tq-comment-btn {
    cursor: pointer; border: none; background: none; padding: 2px 6px;
    border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;
    transition: background .15s;
}
.tq-task-comment-indicator.tq-comment-btn:hover { background: #EFF6FF; }

/* ── Comment popup modal ── */
.tq-modal-comment { max-width: 520px; }

/* ── SuperAdmin Users pages ── */
.sa-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.sa-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.sa-page-title { font-size: 20px; font-weight: 700; color: #0F172A; margin: 0; }
.sa-page-sub { font-size: 13px; color: #64748B; margin: 4px 0 0; }
.sa-cards-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.sa-card { background: #fff; border: 1px solid var(--stroke); border-radius: var(--radius-md); padding: 16px 20px; box-shadow: var(--shadow-sm); }
.sa-card-sm { flex: 1; min-width: 120px; }
.sa-card-danger { border-color: #FECACA; background: #FFF5F5; }
.sa-card-label { font-size: 11px; font-weight: 600; color: #94A3B8; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.sa-section-title { font-size: 14px; font-weight: 600; color: #0F172A; margin: 0 0 12px; }
.sa-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.sa-input { padding: 8px 12px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); font-size: 13px; outline: none; }
.sa-input:focus { border-color: var(--accent); }
.sa-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sa-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--stroke); font-size: 11px; font-weight: 600; color: #64748B; text-transform: uppercase; letter-spacing: .4px; }
.sa-table td { padding: 10px 12px; border-bottom: 1px solid #F1F5F9; color: #374151; vertical-align: middle; }
.sa-table tr:hover td { background: var(--row-hover); }
.sa-table-sm th, .sa-table-sm td { padding: 6px 8px; font-size: 12px; }
.sa-row-danger td { background: #FFF5F5; }
.sa-row-warn   td { background: #FFFBEB; }
.sa-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.sa-badge-success { background: var(--success-soft); color: var(--success); }
.sa-badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.sa-badge-warn    { background: #FEF3C7; color: #92400E; }
.sa-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: background .15s; }
.sa-btn-primary  { background: var(--accent); color: #fff; }
.sa-btn-primary:hover { background: #1D4ED8; }
.sa-btn-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--stroke); }
.sa-btn-secondary:hover { background: var(--hover); }
.sa-btn-success  { background: var(--success); color: #fff; }
.sa-btn-success:hover { background: #15803D; }
.sa-btn-danger   { background: var(--danger); color: #fff; }
.sa-btn-danger:hover { background: #B91C1C; }
.sa-btn-ghost    { background: transparent; color: #64748B; }
.sa-btn-ghost:hover { background: var(--hover); }
.sa-btn-xs { padding: 4px 10px; font-size: 12px; }


/* =============================================================
   TODO QUICK v7 — UX + MOBILE
   ============================================================= */

/* ── Barre d'outils (recherche + filtres) ── */
.tq-toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding-bottom: 4px;
}
.tq-toolbar-search {
    flex: 1; min-width: 180px;
    position: relative; display: flex; align-items: center;
}
.tq-search-icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.tq-search-input { padding-left: 36px !important; padding-right: 32px !important; }
.tq-search-clear {
    position: absolute; right: 10px;
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 14px; padding: 2px 4px; border-radius: 4px;
}
.tq-search-clear:hover { color: var(--danger); background: var(--danger-soft); }
.tq-toolbar-filters { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tq-filter-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 12px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 500;
    background: var(--surface); border: 1.5px solid var(--stroke);
    color: var(--muted); cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.tq-filter-btn:hover { background: var(--hover); }
.tq-filter-btn[data-active="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tq-filter-select {
    padding: 7px 10px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--stroke); background: var(--surface);
    font-size: 12px; color: var(--text); cursor: pointer; max-width: 150px;
}
.tq-filter-select:focus { border-color: var(--accent); outline: none; }

/* ── Date d'echeance sur les taches ── */
.tq-task-due {
    display: inline-flex; align-items: center;
    padding: 1px 7px; border-radius: 99px;
    font-size: 11px; font-weight: 600;
    background: var(--surface-alt); color: var(--muted);
    border: 1px solid var(--stroke); white-space: nowrap; flex-shrink: 0;
}
.tq-task-due--overdue {
    background: var(--danger-soft); color: var(--danger); border-color: #FECACA;
    animation: tq-pulse-due 2s ease infinite;
}
@keyframes tq-pulse-due { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }

/* ── Compteur sous-taches ameliore ── */
.tq-task-item.is-done .tq-child-count { background: var(--success-soft); color: var(--success); border-color: #BBF7D0; }

/* ── Sidebar hamburger toggle (mobile) ── */
.tq-sidebar-toggle {
    display: none;
    align-items: center; gap: 8px;
    padding: 10px 16px;
    background: var(--surface); border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    font-size: 13px; font-weight: 600; color: var(--text);
    cursor: pointer; width: 100%; transition: background .15s;
}
.tq-sidebar-toggle:hover { background: var(--hover); }

/* ── Overlay sidebar mobile ── */
.tq-sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 198;
    background: rgba(15,23,42,.5);
}
.tq-sidebar-overlay--visible { display: block; }

/* ── RESPONSIVE v7 (remplace et complète les anciens media queries) ── */
@media (max-width: 900px) {
    .tq-layout { grid-template-columns: 1fr; }
    .tq-sidebar-toggle { display: flex; }

    .tq-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 199;
        width: 300px; max-width: 85vw;
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        transform: translateX(-105%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
        overflow-y: auto;
        flex-direction: column;
        padding: 20px 16px;
        gap: 16px;
    }
    .tq-sidebar--open { transform: translateX(0); }
    .tq-sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; }
    .tq-main-card { min-height: 300px; }
    .tq-progress-bar { width: 80px; }
    .tq-section-list-wrap { flex: 1; }
}

@media (max-width: 600px) {
    :root { --topbar-h: 48px; }

    /* Evite le zoom auto d'iOS sur focus des inputs */
    input, select, textarea { font-size: 16px !important; }
    .tq-input { font-size: 16px !important; }

    .tq-app { padding: 8px 10px; gap: 8px; }
    .tq-main-card { padding: 12px; gap: 12px; border-radius: var(--radius-md); }
    .tq-auth-card { padding: 24px 16px; }

    /* Topbar : compacter */
    .tq-topbar { padding: 0 10px; gap: 8px; }
    .tq-logo-text { display: none; }
    .tq-nav-link span { display: none; }
    .tq-nav-link { padding: 6px 8px; }
    .tq-board-switch-name { max-width: 80px; }

    /* Header section */
    .tq-main-header { flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 12px; }
    .tq-main-header-right { display: flex; flex-wrap: wrap; gap: 6px; }
    .tq-main-title { font-size: 16px; }
    .tq-avatar-lg { width: 38px; height: 38px; font-size: 15px; }

    /* Barre ajout */
    .tq-add-bar { flex-direction: column; gap: 8px; }
    .tq-add-bar .tq-btn { width: 100%; justify-content: center; }

    /* Toolbar filtres */
    .tq-toolbar { gap: 8px; }
    .tq-toolbar-filters { flex-wrap: wrap; gap: 6px; }
    .tq-filter-select { max-width: 130px; font-size: 12px; }

    /* Taches : plus d'espace tactile (44px minimum WCAG) */
    .tq-task-row { padding: 11px 8px; min-height: 44px; }
    .tq-checkbox-box { width: 24px; height: 24px; border-radius: 7px; }
    .tq-icon-btn { width: 36px; height: 36px; }
    .tq-toggle-btn { padding: 6px; }

    /* Toujours afficher les actions (pas juste au hover, car pas de hover touch) */
    .tq-row-actions { display: flex !important; }
    .tq-section-actions { display: flex !important; right: 2px; }

    /* Indentation reduite */
    .tq-children { padding-left: 16px; }

    /* Badge date echeance plus compact */
    .tq-task-due { font-size: 10px; padding: 1px 5px; }

    /* Metrics */
    .tq-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
    .tq-metric-value { font-size: 20px; }

    /* Modales */
    .tq-modal { max-width: calc(100vw - 20px); margin: 10px; }
    .tq-modal-body { padding: 16px; }
    .tq-modal-footer { padding: 12px 16px 16px; }

    /* Auth */
    .tq-auth-wrap { padding: 12px; align-items: flex-start; }

    /* Sidebar toggle prend toute la largeur */
    .tq-sidebar-toggle { font-size: 14px; }

    /* SuperAdmin tables : scroll horizontal */
    .sa-card { overflow-x: auto; }
}

/* ── Touch : pas de hover sur les icones en mobile ── */
@media (hover: none) {
    .tq-task-row:hover { background: transparent; }
    .tq-section-item:hover { border-color: var(--stroke); box-shadow: none; }
    .tq-icon-btn:hover { background: none; color: var(--muted); }
}
