/* assets/css/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #F7F6F2;
  --surface:   #FFFFFF;
  --border:    #E0DED8;
  --text:      #1C1B19;
  --text-sec:  #6B6A66;
  --text-hint: #A09F9B;
  --accent:    #378ADD;
  --success:   #1D9E75;
  --danger:    #E24B4A;
  --warn-bg:   #FAECE7;
  --purple-bg: #EEEDFE;
  --purple-fg: #3C3489;
  --time-bg:   #EFF6FF;
  --time-fg:   #1D4ED8;
  --prio-h-bg: #FAECE7; --prio-h-fg: #993C1D;
  --prio-m-bg: #FAEEDA; --prio-m-fg: #854F0B;
  --prio-b-bg: #EAF3DE; --prio-b-fg: #3B6D11;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}

body { background: var(--bg); color: var(--text); font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 14px; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar { background: var(--surface); border-bottom: 1px solid var(--border);
          display: flex; align-items: center; justify-content: space-between;
          padding: 0 24px; height: 52px; position: sticky; top: 0; z-index: 100; }
.navbar .brand { font-size: 18px; font-weight: bold; color: var(--text); text-decoration: none; }
.nav-links a { color: var(--text-sec); text-decoration: none; margin-left: 20px; padding: 6px 2px;
               border-bottom: 2px solid transparent; font-size: 13px; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Container ─────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; }
.card-body { padding: 14px 16px; }

/* ── Tâche card ─────────────────────────────────────────────── */
.tache-card { display: flex; align-items: stretch; border-radius: var(--radius);
              background: var(--surface); border: 1px solid var(--border);
              box-shadow: var(--shadow); margin-bottom: 8px; overflow: hidden; }
.tache-card.overdue { border-color: var(--danger); }
.tache-card.faite   { opacity: .65; }
.tache-band { width: 4px; flex-shrink: 0; }
.tache-body { flex: 1; padding: 12px 14px; }

.tache-row1 { display: flex; align-items: flex-start; gap: 10px; }
.tache-row1 .texte { flex: 1; font-size: 14px; font-weight: 500; cursor: pointer; }
.tache-row1 .texte.done { text-decoration: line-through; color: var(--text-hint); }
.tache-actions { display: flex; gap: 6px; }
.tache-actions a, .tache-actions button { background: none; border: none; cursor: pointer;
  color: var(--text-hint); font-size: 13px; padding: 2px 4px; text-decoration: none; }
.tache-actions a:hover, .tache-actions button:hover { color: var(--accent); }
.tache-actions .del:hover { color: var(--danger); }

.tache-row2 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tache-row3 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 5px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; border-radius: 4px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.badge-haute    { background: var(--prio-h-bg); color: var(--prio-h-fg); }
.badge-moyenne  { background: var(--prio-m-bg); color: var(--prio-m-fg); }
.badge-basse    { background: var(--prio-b-bg); color: var(--prio-b-fg); }
.badge-cat      { background: #E3F2FD; color: #1565C0; }
.badge-rec      { background: var(--purple-bg); color: var(--purple-fg); }
.badge-time     { background: var(--time-bg); color: var(--time-fg); }
.badge-retard   { background: var(--warn-bg); color: var(--danger); }
.badge-int      { background: var(--purple-bg); color: var(--purple-fg); }
.badge-success  { background: #EAF3DE; color: var(--success); }

.text-hint  { color: var(--text-hint); font-size: 12px; }
.text-accent { color: var(--accent); font-size: 12px; cursor: pointer; }

/* ── Checkbox ───────────────────────────────────────────────── */
.check-circle { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border);
                display: inline-flex; align-items: center; justify-content: center;
                cursor: pointer; flex-shrink: 0; margin-top: 1px; }
.check-circle.done { background: var(--success); border-color: var(--success); color: white; font-size: 11px; }
.check-circle:hover { border-color: var(--accent); }

/* ── Toolbar ────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.btn { display: inline-block; padding: 6px 14px; border-radius: 6px; border: none;
       font-size: 13px; cursor: pointer; text-decoration: none; }
.btn-primary   { background: var(--accent); color: white; }
.btn-secondary { background: var(--border); color: var(--text-sec); }
.btn-danger    { background: var(--danger); color: white; }
.btn-ghost     { background: transparent; border: 1px solid var(--border); color: var(--text-sec); }
.btn.active    { background: var(--text); color: white; }
.btn:hover     { opacity: .88; }

/* ── Formulaire ─────────────────────────────────────────────── */
.form-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.form-control { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
                font-size: 13px; background: var(--surface); color: var(--text); }
.form-control:focus { outline: none; border-color: var(--accent); }
input.form-control { flex: 1; min-width: 200px; }
select.form-control { min-width: 130px; }

/* ── Sous-tâches ────────────────────────────────────────────── */
.sous-taches { margin-top: 10px; padding: 8px 12px; background: var(--bg);
               border-radius: 6px; }
.sous-tache-row { display: flex; align-items: center; gap: 8px; padding: 4px 0;
                  border-bottom: 1px solid var(--border); }
.sous-tache-row:last-child { border-bottom: none; }
.sous-tache-row .texte { flex: 1; font-size: 13px; }
.sous-tache-row .texte.done { text-decoration: line-through; color: var(--text-hint); }

/* ── Progress bar ───────────────────────────────────────────── */
.progress { background: var(--border); border-radius: 3px; height: 5px; margin: 6px 0; }
.progress-bar { background: var(--success); height: 100%; border-radius: 3px; transition: width .3s; }

/* ── Stats cards ────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
             padding: 16px; text-align: center; }
.stat-card .val { font-size: 28px; font-weight: bold; }
.stat-card .lbl { font-size: 12px; color: var(--text-hint); margin-top: 4px; }

/* ── Table ──────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: var(--bg); padding: 8px 12px; text-align: left;
            border-bottom: 2px solid var(--border); color: var(--text-sec); }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: #FAFAF8; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200; }
.modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 24px;
         min-width: 340px; max-width: 520px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.modal h3 { margin-bottom: 16px; font-size: 15px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── Utilitaires ────────────────────────────────────────────── */
.flex   { display: flex; }
.gap-8  { gap: 8px; }
.mt-16  { margin-top: 16px; }
.mb-16  { margin-bottom: 16px; }
.text-right { text-align: right; }
.w-100  { width: 100%; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }

/* ── Charts wrapper ─────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.chart-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.chart-card h4 { font-size: 13px; color: var(--text-sec); margin-bottom: 12px; }
