/* ==================================================================== */
/*  HERMÈS — Design System « Editorial Pastel vibrant » (Stitch 2026)   */
/*  Porté du export Stitch → CSS pur, zéro dépendance CDN, offline.      */
/* ==================================================================== */
: root {
  --bg: #fffdf9;
  --bg-elevated: #faf6f1;
  --surface: #ffffff;
  --surface-strong: #f6f0e8;
  --border: #f1eae0;
  --border-strong: #e7dfd5;
  --ink: #2d2a26;
  --ink-dim: #706b63;
  --ink-variant: #675955;
  --coral: #ff6b4a;
  --coral-d: #e85837;
  --coral-bg: #fff0eb;
  --coral-border: #ffd5c9;
  --lavande: #8b72de;
  --lavande-d: #7559d6;
  --lavande-bg: #f4f0fd;
  --lavande-border: #ddd2f9;
  --menthe: #10b981;
  --menthe-d: #059669;
  --menthe-bg: #ecfdf5;
  --menthe-border: #a7f3d0;
  --miel: #f59e0b;
  --miel-bg: #fef3c7;
  --miel-border: #fde68a;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text-xs: 11px; --text-sm: 13px; --text-base: 15px; --text-lg: 17px;
  --text-xl: 20px; --text-2xl: 24px; --text-3xl: 28px; --text-4xl: 34px; --text-display: 44px;
  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 24px; --r-pill: 9999px;
  --s-xs: 4px; --s-sm: 8px; --s-md: 12px; --s-lg: 16px; --s-xl: 24px; --s-2xl: 32px; --s-3xl: 48px;
  --shadow-xs: 0 1px 2px rgba(45,42,38,.05);
  --shadow-sm: 0 2px 8px rgba(45,42,38,.04), 0 0 0 1px var(--border);
  --shadow: 0 4px 12px rgba(45,42,38,.04), 0 0 0 1px var(--border);
  --shadow-lg: 0 10px 30px -5px rgba(45,42,38,.06);
  --shadow-xl: 0 20px 40px -10px rgba(45,42,38,.08);
  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --tap: 44px; --nav-height: 88px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --accent: var(--coral); --accent-hover: var(--coral-d); --accent-soft: var(--coral-bg);
  --text-primary: var(--ink); --text-secondary: var(--ink-dim); --text-muted: var(--ink-variant);
  --success: #22c55e; --success-soft: #dcfce7;
  --warning: var(--miel); --warning-soft: var(--miel-bg);
  --danger: #ef4444; --danger-soft: #fee2e2;
  --shadow-md: var(--shadow);
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 15px; line-height: 1.55; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; min-height: 100vh; }
img, svg, picture { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
::-webkit-scrollbar { display: none; }
#app { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.wrap { max-width: 440px; margin: 0 auto; padding: 0 16px; }
.pb-safe { padding-bottom: var(--safe-bottom); }
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid, .list { display: flex; flex-direction: column; gap: var(--s-md); }
header.app-header { position: sticky; top: 0; z-index: 40; background: rgba(255,253,249,.9); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-strong); padding: 12px 16px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-avatar { width: 36px; height: 36px; border-radius: var(--r-sm); background: linear-gradient(135deg, var(--coral), #ff8e75); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 600; flex-shrink: 0; }
.header-title { font-family: var(--font-serif); font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.header-date { font-size: 12px; color: var(--ink-dim); font-weight: 600; }
.header-subtitle { font-size: 13px; color: var(--ink-dim); }
.topbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--s-xl); padding-top: 48px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-title { font-family: var(--font-serif); font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.topbar-sub { font-size: 13px; color: var(--ink-dim); }
.content { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px; padding-bottom: calc(var(--s-3xl) + 96px); scroll-behavior: smooth; }
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.section-title { font-family: var(--font-serif); font-size: 22px; font-weight: 500; letter-spacing: -.005em; margin: var(--s-xl) 0 var(--s-md); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title .count { font-family: var(--font-sans); font-size: 12px; font-weight: 700; color: var(--ink-dim); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card-strong { background: linear-gradient(160deg, var(--surface), var(--surface-strong)); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.card-lavande { background: var(--lavande-bg); border-color: var(--lavande-border); }
.card-coral { background: var(--coral-bg); border-color: var(--coral-border); }
.card-menthe { background: var(--menthe-bg); border-color: var(--menthe-border); }
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.focus-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 0 0 18px; position: relative; overflow: hidden; }
.focus-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--coral); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.focus-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--coral); padding: 0 18px; margin-top: 14px; }
.focus-title { font-family: var(--font-serif); font-size: 26px; font-weight: 500; letter-spacing: -.01em; padding: 0 18px; margin-bottom: 6px; }
.focus-why { font-size: 14px; color: var(--ink-dim); padding: 0 18px; margin-bottom: 12px; }
.focus-next { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-dim); padding: 0 18px; margin-bottom: 12px; text-align: left; }
.focus-next span:first-child { font-size: 20px; }
.focus-next b { color: var(--ink); font-weight: 600; }

/* Micro-jauge circulaire */
.metric-ring { width: 52px; height: 52px; flex-shrink: 0; }
.metric-ring svg { width: 100%; height: 100%; }
.metric-value { font-family: var(--font-serif); font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.metric-label { font-size: 12px; color: var(--ink-dim); }

/* Micro-priorité (single primary action) */
.priority-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 8px;
  border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface);
}
.priority-item.active { border-color: var(--coral); }
.priority-check { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 50%; background: var(--surface); cursor: pointer; flex-shrink: 0; }
.priority-check.checked { background: var(--coral); border-color: var(--coral); color: #fff; }
.priority-text { font-size: 14px; font-weight: 500; flex: 1; }
.priority-time { font-size: 11px; color: var(--ink-dim); background: var(--bg-elevated); padding: 2px 7px; border-radius: 9999px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 10px 18px; border-radius: 14px; font-family: var(--font-sans); font-size: 14px; font-weight: 500; border: none; cursor: pointer; text-decoration: none; white-space: nowrap; transition: all var(--transition); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 4px 14px rgba(255,107,74,.25); }
.btn-primary:hover { background: var(--coral-d); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,107,74,.32); }
.btn-primary:active { transform: scale(.96); }
.btn-secondary { background: var(--bg-elevated); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-strong); }
.btn-ghost { background: transparent; color: var(--ink-dim); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-strong); color: var(--ink); }
.btn-sm { padding: 7px 13px; font-size: 12px; min-height: 34px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 2px; padding: 2px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; }
.badge-coral { background: var(--coral-bg); color: var(--coral); border: 1px solid var(--coral-border); }
.badge-lavande { background: var(--lavande-bg); color: var(--lavande); border: 1px solid var(--lavande-border); }
.badge-menthe { background: var(--menthe-bg); color: var(--menthe); border: 1px solid var(--menthe-border); }
.badge-miel { background: var(--miel-bg); color: #783208; border: 1px solid var(--miel-border); }
.badge-soft { background: rgba(45,42,38,.04); color: var(--ink-dim); border: 1px solid var(--border); }
.badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-campus, .badge-etudes { background: var(--lavande-bg); color: var(--lavande); }
.badge-atelier, .badge-creation { background: var(--coral-bg); color: var(--coral); }
.badge-maison { background: var(--menthe-bg); color: var(--menthe); }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-height: var(--tap); transition: all var(--transition); }
.task:hover { border-color: var(--border-strong); background: var(--surface-strong); }
.task.clickable { cursor: pointer; }
.task.done { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }
.task-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent; transition: all var(--transition); flex-shrink: 0; padding: 0; }
.task-check:hover { border-color: var(--coral); background: var(--coral-bg); }
.task-check.checked { background: var(--coral); border-color: var(--coral); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-dim); margin-top: 2px; flex-wrap: wrap; }

.bento-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 8px; }
.bento-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; transition: all var(--transition); cursor: pointer; text-align: left; }
.bento-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.bento-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.bento-card-icon { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.bento-card-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.bento-card-value { font-family: var(--font-serif); font-size: 26px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.bento-card-label { font-size: 11px; color: var(--ink-dim); }

.nav-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); cursor: pointer; text-align: left; width: 100%; font-family: inherit; transition: all var(--transition); }
.nav-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.nav-card-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.nav-card-body { flex: 1; min-width: 0; }
.nav-card-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.nav-card-sub { font-size: 13px; color: var(--ink-dim); }
.nav-card-arrow { color: var(--ink-dim); flex-shrink: 0; }

.command-bar { position: fixed; bottom: calc(var(--nav-height) + 12px); inset-x: 0; padding: 0 16px; z-index: 30; }
.input-wrap, .capture-form { display: flex; gap: 10px; }
.capture-form { max-width: 440px; margin: 0 auto; }
.capture-input { flex: 1; min-height: var(--tap); padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); font-size: 15px; color: var(--ink); outline: none; transition: all var(--transition); }
.capture-input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-bg); }
.capture-input::placeholder { color: var(--ink-dim); opacity: .5; }
.capture-send { width: var(--tap); height: var(--tap); border-radius: var(--r-lg); border: none; background: var(--coral); color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); flex-shrink: 0; }
.capture-send:hover { background: var(--coral-d); transform: scale(1.05); }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-height); height: calc(var(--nav-height) + var(--safe-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(20px); border-top: 1px solid var(--border); padding-bottom: max(12px, var(--safe-bottom)); z-index: 50; }
.tabbar-inner { display: flex; justify-content: space-around; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: none; background: none; color: var(--ink-dim); font-family: inherit; font-size: 10px; font-weight: 600; cursor: pointer; transition: color var(--transition); flex: 1; }
.tab.active { color: var(--coral); }
.tab .icon, .tab svg { width: 20px; height: 20px; margin-bottom: 2px; }
.tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.search-box { margin-bottom: 16px; }
.search-box input { width: 100%; min-height: var(--tap); padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); font-size: 15px; color: var(--ink); outline: none; transition: all var(--transition); }
.search-box input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-bg); }
.search-box input::placeholder { color: var(--ink-dim); }

.tap { transition: all .12s ease; }
.tap:active { opacity: .85; }
.rotate-45 { display: inline-block; transition: transform .3s ease; }
.rotate-45:hover { transform: rotate(45deg) scale(1.15); }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-dim); }
.empty-icon { font-size: 40px; display: block; margin-bottom: 16px; opacity: .5; }

/* Mode Brume */
.mode-brume { position: fixed; inset: 0; background: var(--bg); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 400ms ease; }
.mode-brume.active { opacity: 1; pointer-events: auto; }
.brume-content { text-align: center; max-width: 380px; padding: 32px; }
.brume-icon { font-size: 48px; margin-bottom: 16px; }
.brume-title { font-family: var(--font-serif); font-size: 24px; font-weight: 500; margin-bottom: 12px; }
.brume-task { font-size: 18px; color: var(--ink-dim); margin-bottom: 20px; }
.brume-actions { display: flex; flex-direction: column; gap: 12px; }

/* Modale */
.modal-overlay { position: fixed; inset: 0; background: rgba(45,42,38,.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 200; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.modal-head h2 { font-family: var(--font-serif); font-size: 24px; font-weight: 500; }
.modal pre { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; font-size: 12px; line-height: 1.5; color: var(--ink-dim); white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow-y: auto; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.field label { font-size: 12px; color: var(--ink-dim); font-weight: 600; }
.field input, .field select, .field textarea { background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 12px; color: var(--ink); font-size: 15px; font-family: inherit; }
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-bg); }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mini-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Toast */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 10px 16px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all 300ms ease; z-index: 300; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 400ms ease forwards; }

/* Desktop */
@media (min-width: 900px) {
  #app { flex-direction: row; }
  .sidebar { display: flex; width: 250px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); flex-direction: column; padding: var(--s-xl) var(--s-lg); gap: var(--s-xs); }
  .sidebar-brand { font-family: var(--font-serif); font-size: 20px; font-weight: 600; padding: var(--s-sm) var(--s-md); margin-bottom: var(--s-lg); }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-item { display: flex; align-items: center; gap: var(--s-md); padding: 10px var(--s-md); border-radius: var(--r-md); color: var(--ink-dim); font-weight: 500; text-align: left; width: 100%; border: none; background: none; cursor: pointer; }
  .nav-item:hover { background: var(--bg-elevated); color: var(--ink); }
  .nav-item.active { background: var(--coral-bg); color: var(--coral); }
  .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
  .sidebar-footer { margin-top: auto; padding-top: var(--s-lg); border-top: 1px solid var(--border); }
  .tabbar { display: none; }
  .content { padding: var(--s-xl) var(--s-2xl); padding-bottom: calc(var(--s-3xl) + 96px); }
  .command-bar { bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
