/* =================================================================
   AI Chat Platform — Design system
   Inspiration : terminal/IDE moderne, mais éditorial. Mono pour code,
   Söhne-like Inter Tight pour body. Accent vert phosphorescent.
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Instrument+Serif&display=swap');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Tokens ---------- */
:root {
    --bg:           #0d0e10;
    --bg-1:         #131418;
    --bg-2:         #191b20;
    --bg-3:         #22252c;
    --border:       #2a2d35;
    --border-2:     #3a3e48;
    --fg:           #e9eaee;
    --fg-dim:       #a4a8b3;
    --fg-muted:     #6a6e7a;
    --accent:       #b6f25a;       /* vert phosphorescent */
    --accent-fg:    #0d0e10;
    --accent-dim:   #7da53d;
    --danger:       #ff5d5d;
    --warning:      #ffb454;
    --info:         #6cb6ff;
    --shadow-1:     0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
    --shadow-2:     0 8px 40px rgba(0,0,0,.45);
    --radius-sm:    6px;
    --radius:       10px;
    --radius-lg:    16px;
    --mono:         'JetBrains Mono', 'Menlo', monospace;
    --serif:        'Instrument Serif', 'Times New Roman', serif;
}

/* ---------- Layout app ---------- */
.app {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    height: 100%;
    min-height: 0;
}
.sidebar__brand {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar__brand-mark {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #6cf2c8);
    display: grid; place-items: center;
    color: var(--accent-fg);
    font-family: var(--mono); font-weight: 700; font-size: 13px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset;
}
.sidebar__brand-name {
    font-family: var(--serif);
    font-size: 22px;
    letter-spacing: .2px;
    line-height: 1;
}
.sidebar__brand-name em { color: var(--accent); font-style: normal; }

.sidebar__new {
    margin: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    background: var(--bg-2);
    color: var(--fg);
    font-weight: 500;
    display: flex; align-items: center; gap: 8px;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.sidebar__new:hover { background: var(--bg-3); border-color: var(--accent); }
.sidebar__new:active { transform: translateY(1px); }
.sidebar__new svg { width: 14px; height: 14px; stroke: var(--accent); }

.sidebar__nav { padding: 0 8px; }
.sidebar__nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px;
    color: var(--fg-dim); font-size: 13.5px;
    text-decoration: none;
}
.sidebar__nav a:hover { background: var(--bg-2); color: var(--fg); }
.sidebar__nav a.active { background: var(--bg-2); color: var(--fg); }
.sidebar__nav a svg { width: 14px; height: 14px; }

.sidebar__section-title {
    padding: 18px 20px 6px;
    font-size: 11px; letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--fg-muted);
    font-weight: 500;
}

.conv-list {
    overflow-y: auto;
    flex: 1; min-height: 0;
    padding: 0 8px 8px;
}
.conv-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 8px;
    color: var(--fg-dim);
    cursor: pointer; font-size: 13.5px;
    overflow: hidden;
    position: relative;
}
.conv-item:hover { background: var(--bg-2); color: var(--fg); }
.conv-item.active { background: var(--bg-2); color: var(--fg); }
.conv-item.active::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 2px; background: var(--accent); border-radius: 2px;
}
.conv-item__title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item__delete {
    opacity: 0; padding: 4px;
    color: var(--fg-muted);
    transition: opacity .15s ease, color .15s ease;
}
.conv-item:hover .conv-item__delete { opacity: 1; }
.conv-item__delete:hover { color: var(--danger); }

.sidebar__footer {
    border-top: 1px solid var(--border);
    padding: 10px 12px;
    display: flex; align-items: center; gap: 10px;
}
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg-3); color: var(--fg);
    display: grid; place-items: center;
    font-size: 12px; font-weight: 600;
}
.user-name { font-size: 13px; flex: 1; }
.user-name small { display: block; color: var(--fg-muted); font-size: 11px; }
.badge-premium {
    background: linear-gradient(135deg, var(--accent), #6cf2c8);
    color: var(--accent-fg);
    font-size: 10px; font-weight: 700;
    padding: 2px 6px; border-radius: 4px;
    letter-spacing: .04em;
}
.badge-free {
    background: var(--bg-3);
    color: var(--fg-dim);
    font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: 4px;
}

/* ---------- Main ---------- */
.main {
    display: flex; flex-direction: column;
    min-width: 0; min-height: 0;
}

.topbar {
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    padding: 0 20px;
    display: flex; align-items: center; gap: 16px;
}
.topbar__title {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--fg);
    flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.model-select {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--fg);
    font-family: var(--mono);
}
.model-select:hover { border-color: var(--border-2); }

.icon-btn {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: grid; place-items: center;
    color: var(--fg-dim);
    border: 1px solid transparent;
    transition: all .15s ease;
}
.icon-btn:hover { background: var(--bg-2); color: var(--fg); border-color: var(--border); }
.icon-btn.active { color: var(--accent); border-color: var(--border-2); background: var(--bg-2); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Chat ---------- */
.chat-area {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: 24px 0 120px;
}
.chat-inner { max-width: 820px; margin: 0 auto; padding: 0 24px; }

.empty-state {
    height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 40px;
    color: var(--fg-dim);
}
.empty-state h1 {
    font-family: var(--serif);
    font-size: 44px;
    line-height: 1.1;
    color: var(--fg);
    margin-bottom: 12px;
    letter-spacing: -.5px;
}
.empty-state h1 em { color: var(--accent); font-style: italic; }
.empty-state p { max-width: 480px; }
.empty-suggestions {
    margin-top: 28px;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    max-width: 600px; width: 100%;
}
.empty-suggestions button {
    text-align: left; padding: 14px 16px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg-dim); font-size: 13px;
    transition: all .15s ease;
}
.empty-suggestions button:hover { border-color: var(--accent); color: var(--fg); transform: translateY(-1px); }
.empty-suggestions strong { color: var(--fg); display: block; font-weight: 500; margin-bottom: 2px; }

/* Bubbles */
.msg {
    display: flex; gap: 14px;
    margin-bottom: 28px;
    animation: msgIn .25s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.msg__avatar {
    width: 28px; height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700;
}
.msg.user .msg__avatar { background: var(--bg-3); color: var(--fg); }
.msg.assistant .msg__avatar {
    background: linear-gradient(135deg, var(--accent), #6cf2c8);
    color: var(--accent-fg);
    font-family: var(--mono);
}
.msg__body { flex: 1; min-width: 0; }
.msg__head {
    display: flex; align-items: baseline; gap: 10px;
    margin-bottom: 6px;
    font-size: 12px; color: var(--fg-muted);
}
.msg__head strong { color: var(--fg); font-weight: 600; font-size: 13px; }
.msg__model { font-family: var(--mono); font-size: 11px; color: var(--accent-dim); }
.msg__cost { font-family: var(--mono); font-size: 11px; color: var(--fg-muted); margin-left: auto; }

.msg__content {
    color: var(--fg);
    font-size: 14.5px;
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.msg__content p { margin: 0 0 12px; }
.msg__content p:last-child { margin-bottom: 0; }
.msg__content h1, .msg__content h2, .msg__content h3 {
    font-family: var(--serif);
    margin: 18px 0 10px;
    line-height: 1.2;
}
.msg__content h1 { font-size: 24px; }
.msg__content h2 { font-size: 20px; }
.msg__content h3 { font-size: 17px; }
.msg__content ul, .msg__content ol { margin: 10px 0 12px 24px; }
.msg__content li { margin-bottom: 4px; }
.msg__content code {
    font-family: var(--mono); font-size: 13px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 1px 6px; border-radius: 4px;
}
.msg__content pre {
    margin: 12px 0;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}
.msg__content pre code {
    display: block;
    background: transparent; border: 0;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.55;
    overflow-x: auto;
    color: #e9eaee;
}
.copy-code {
    position: absolute; top: 8px; right: 8px;
    padding: 4px 8px; font-size: 11px;
    background: var(--bg-3); color: var(--fg-dim);
    border-radius: 6px; font-family: var(--mono);
    opacity: 0; transition: opacity .15s ease;
}
.msg__content pre:hover .copy-code { opacity: 1; }
.copy-code:hover { color: var(--accent); }

.msg__content blockquote {
    border-left: 2px solid var(--accent); padding-left: 14px;
    color: var(--fg-dim); margin: 10px 0;
}
.msg__content table {
    border-collapse: collapse; margin: 12px 0;
    font-size: 13px;
}
.msg__content th, .msg__content td {
    border: 1px solid var(--border);
    padding: 6px 10px; text-align: left;
}
.msg__content th { background: var(--bg-2); font-weight: 600; }

.msg__workflow-tags {
    margin-top: 8px;
    display: flex; flex-wrap: wrap; gap: 4px;
}
.workflow-tag {
    font-family: var(--mono); font-size: 10px;
    padding: 2px 6px; border-radius: 4px;
    background: var(--bg-2); color: var(--accent-dim);
    border: 1px solid var(--border);
}

/* Composer */
.composer-wrap {
    position: fixed; left: 280px; right: 0; bottom: 0;
    padding: 16px 24px 24px;
    background: linear-gradient(180deg, transparent 0%, var(--bg) 30%);
    pointer-events: none;
}
.composer {
    pointer-events: auto;
    max-width: 820px; margin: 0 auto;
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-2);
    transition: border-color .2s ease;
}
.composer:focus-within { border-color: var(--accent); }
.composer.dragover {
    border-color: var(--accent);
    background: rgba(182,242,90,.05);
}
.composer__input {
    width: 100%; min-height: 48px; max-height: 240px;
    background: transparent; border: 0; outline: 0;
    color: var(--fg);
    resize: none; line-height: 1.55;
    padding: 6px 8px;
}
.composer__row {
    display: flex; align-items: center; gap: 8px;
    padding-top: 6px;
}
.composer__counter {
    flex: 1;
    font-family: var(--mono); font-size: 11px;
    color: var(--fg-muted);
}
.composer__counter.over { color: var(--danger); }
.composer__send {
    background: var(--accent);
    color: var(--accent-fg);
    font-weight: 600; font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex; align-items: center; gap: 6px;
    transition: transform .1s ease, opacity .15s ease;
}
.composer__send:hover { transform: translateY(-1px); }
.composer__send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.composer__send svg { width: 14px; height: 14px; }

/* Workflow toolbar */
.workflow-toolbar {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}
.wf-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--fg-dim);
    font-size: 11.5px;
    font-family: var(--mono);
    transition: all .15s ease;
}
.wf-chip:hover { color: var(--fg); border-color: var(--border-2); }
.wf-chip.active {
    background: rgba(182,242,90,.12);
    color: var(--accent);
    border-color: var(--accent-dim);
}
.wf-chip svg { width: 12px; height: 12px; }
.wf-chip select {
    background: transparent; border: 0; outline: 0;
    color: inherit; font: inherit; padding: 0;
}

/* ---------- Toast ---------- */
.toast-stack {
    position: fixed; top: 16px; right: 16px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 200;
}
.toast {
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--fg);
    font-size: 13px;
    box-shadow: var(--shadow-2);
    min-width: 240px; max-width: 360px;
    animation: toastIn .25s ease;
}
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--accent); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px;
    background:
      radial-gradient(circle at 20% 30%, rgba(182,242,90,.08), transparent 50%),
      radial-gradient(circle at 80% 70%, rgba(108,242,200,.05), transparent 50%),
      var(--bg);
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-2);
}
.auth-card h1 {
    font-family: var(--serif);
    font-size: 32px; margin-bottom: 6px;
    line-height: 1.1;
}
.auth-card h1 em { color: var(--accent); font-style: italic; }
.auth-card .lede { color: var(--fg-dim); margin-bottom: 28px; }
.field { margin-bottom: 14px; }
.field label {
    display: block; margin-bottom: 6px;
    font-size: 12px; color: var(--fg-dim);
    letter-spacing: .04em; text-transform: uppercase;
    font-weight: 500;
}
.input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    transition: border-color .15s ease;
}
.input:focus { outline: 0; border-color: var(--accent); }
.btn-primary {
    width: 100%;
    background: var(--accent);
    color: var(--accent-fg);
    padding: 11px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
    transition: transform .1s ease;
}
.btn-primary:hover { transform: translateY(-1px); }
.auth-card .alt { margin-top: 16px; text-align: center; font-size: 13px; color: var(--fg-muted); }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
}
.alert.error { background: rgba(255,93,93,.08); border: 1px solid rgba(255,93,93,.3); color: var(--danger); }
.alert.success { background: rgba(182,242,90,.08); border: 1px solid rgba(182,242,90,.3); color: var(--accent); }

/* ---------- Settings / Stats / Files pages ---------- */
.page {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: 32px 32px 80px;
}
.page__header {
    max-width: 920px; margin: 0 auto 24px;
}
.page__header h1 {
    font-family: var(--serif);
    font-size: 36px;
    line-height: 1.1;
    letter-spacing: -.5px;
    margin-bottom: 6px;
}
.page__header h1 em { color: var(--accent); font-style: italic; }
.page__header p { color: var(--fg-dim); }

.page__content { max-width: 920px; margin: 0 auto; display: grid; gap: 20px; }
.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.card h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 4px; }
.card .subtitle { color: var(--fg-dim); font-size: 13px; margin-bottom: 18px; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}
.kpi {
    background: var(--bg-2);
    border-radius: var(--radius);
    padding: 14px 16px;
    border: 1px solid var(--border);
}
.kpi__label { font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi__value { font-family: var(--mono); font-size: 22px; color: var(--fg); margin-top: 4px; }
.kpi__sub { font-size: 11px; color: var(--fg-dim); margin-top: 2px; }

.progress {
    height: 6px; background: var(--bg-3); border-radius: 4px; overflow: hidden;
    margin-top: 8px;
}
.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #6cf2c8);
    border-radius: 4px;
    transition: width .3s ease;
}

.table {
    width: 100%; border-collapse: collapse;
    font-size: 13px;
}
.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th {
    color: var(--fg-muted); font-weight: 500;
    font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.table td.mono { font-family: var(--mono); font-size: 12.5px; }

/* File tree */
.file-tree { font-family: var(--mono); font-size: 13px; }
.file-node {
    padding: 4px 8px;
    border-radius: 6px;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    color: var(--fg-dim);
}
.file-node:hover { background: var(--bg-2); color: var(--fg); }
.file-node__icon { width: 14px; flex-shrink: 0; }
.file-node__name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-node__size { color: var(--fg-muted); font-size: 11px; }
.file-node__actions { opacity: 0; display: flex; gap: 4px; }
.file-node:hover .file-node__actions { opacity: 1; }
.file-children { padding-left: 18px; border-left: 1px dashed var(--border); margin-left: 8px; }

.dropzone {
    border: 2px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    color: var(--fg-dim);
    transition: all .15s ease;
}
.dropzone.dragover {
    border-color: var(--accent);
    background: rgba(182,242,90,.05);
    color: var(--accent);
}

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px;
    position: relative;
}
.plan.featured {
    border-color: var(--accent);
    background:
      linear-gradient(180deg, rgba(182,242,90,.05), transparent 30%),
      var(--bg-1);
}
.plan h3 { font-family: var(--serif); font-size: 26px; margin-bottom: 4px; }
.plan .price { font-family: var(--mono); font-size: 32px; color: var(--fg); margin: 12px 0 4px; }
.plan .price small { font-size: 14px; color: var(--fg-muted); }
.plan ul { list-style: none; padding: 16px 0; border-top: 1px solid var(--border); margin-top: 12px; }
.plan li { padding: 6px 0; color: var(--fg-dim); display: flex; gap: 8px; align-items: flex-start; }
.plan li::before { content: '→'; color: var(--accent); font-family: var(--mono); }

/* Responsive */
@media (max-width: 880px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .composer-wrap { left: 0; }
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ========================================================
   AJOUTS — Pages settings/stats/files/premium + composants
   ======================================================== */

/* Topbar */
.topbar {
    height: 56px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    flex-shrink: 0;
    background: var(--bg);
}
.topbar__left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar__right { display: flex; align-items: center; gap: 8px; }
.topbar__title { font-family: var(--serif); font-size: 22px; margin: 0; color: var(--fg); font-weight: 500; }
.conv-title-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg);
    font-family: var(--serif);
    font-size: 22px;
    padding: 6px 10px;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
}
.conv-title-input:hover { background: var(--bg-2); }
.conv-title-input:focus { outline: none; border-color: var(--border); background: var(--bg-2); }

.select {
    background: var(--bg-2);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: var(--sans);
    font-size: 13px;
    cursor: pointer;
}
.select:focus { outline: none; border-color: var(--accent); }

/* Page container */
.page-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}
.card--highlight {
    background: linear-gradient(135deg, rgba(182, 242, 90, 0.06), transparent);
    border-color: rgba(182, 242, 90, 0.2);
}
.card__title { font-family: var(--serif); font-size: 20px; margin: 0 0 8px 0; font-weight: 500; color: var(--fg); display: flex; align-items: center; gap: 10px; }
.card__sub { color: var(--fg-muted); font-size: 13px; margin: 0 0 16px 0; }

/* KPI */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.kpi {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}
.kpi__label { color: var(--fg-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; font-family: var(--mono); }
.kpi__value { font-family: var(--mono); font-size: 20px; color: var(--fg); margin-bottom: 8px; }

/* Progress */
.progress {
    height: 6px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}
.progress--big { height: 10px; margin-top: 12px; }
.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #d2ff7a);
    transition: width 0.4s ease;
}

/* Forms */
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.form-row:last-child { margin-bottom: 0; }
.form-label { display: flex; justify-content: space-between; align-items: center; color: var(--fg-dim); font-size: 13px; margin-bottom: 4px; font-weight: 500; }
.form-help { color: var(--fg-muted); font-size: 12px; margin-top: 4px; }
.form-help a { color: var(--accent); text-decoration: none; }
.form-help a:hover { text-decoration: underline; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: var(--sans);
    font-size: 14px;
    flex: 1;
    min-width: 0;
}
.input:focus { outline: none; border-color: var(--accent); }
.input:disabled { opacity: 0.6; cursor: not-allowed; }

/* Buttons */
.btn {
    background: var(--bg-3);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
}
.btn--primary:hover:not(:disabled) { background: #d2ff7a; border-color: #d2ff7a; }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; justify-content: center; padding: 14px; font-size: 14px; }
.btn--link {
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 4px 0;
    text-decoration: none;
}
.btn--link:hover { text-decoration: underline; }

.badge-ok {
    background: rgba(182, 242, 90, 0.1);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 11px;
    border: 1px solid rgba(182, 242, 90, 0.25);
}

/* Chat empty state */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}
.empty-state h1 {
    font-family: var(--serif);
    font-size: 44px;
    font-weight: 400;
    margin: 0 0 12px;
    color: var(--fg);
}
.empty-state h1 em { color: var(--accent); font-style: italic; }
.empty-state__sub { color: var(--fg-muted); margin: 0 0 32px; }
.suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    max-width: 720px;
    width: 100%;
}
.suggestion {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    color: var(--fg-dim);
    font-family: var(--sans);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}
.suggestion:hover { background: var(--bg-3); border-color: var(--accent); transform: translateY(-1px); }
.suggestion strong { color: var(--fg); display: block; margin-bottom: 4px; }

/* Chat area & messages */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 200px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}
.messages { display: flex; flex-direction: column; gap: 24px; }

.msg { display: flex; gap: 14px; align-items: flex-start; }
.msg__avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--fg-dim);
    flex-shrink: 0;
}
.msg--user .msg__avatar { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.msg__body { flex: 1; min-width: 0; }
.msg__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.msg__author { font-weight: 600; color: var(--fg); font-size: 13px; }
.msg__tokens { color: var(--fg-muted); font-family: var(--mono); font-size: 11px; }
.msg__content { color: var(--fg-dim); line-height: 1.6; font-size: 15px; }

/* Markdown body */
.markdown-body h1, .markdown-body h2, .markdown-body h3 { font-family: var(--serif); color: var(--fg); margin: 18px 0 10px; font-weight: 500; }
.markdown-body h1 { font-size: 26px; }
.markdown-body h2 { font-size: 22px; }
.markdown-body h3 { font-size: 18px; }
.markdown-body p { margin: 10px 0; }
.markdown-body ul, .markdown-body ol { margin: 10px 0; padding-left: 24px; }
.markdown-body li { margin: 4px 0; }
.markdown-body code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--bg-3);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
}
.markdown-body pre {
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
    margin: 14px 0;
    position: relative;
}
.markdown-body pre code {
    background: transparent;
    color: var(--fg);
    padding: 0;
    font-size: 13px;
}
.markdown-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 14px;
    margin: 12px 0;
    color: var(--fg-muted);
}
.markdown-body table { border-collapse: collapse; margin: 14px 0; width: 100%; }
.markdown-body th, .markdown-body td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.markdown-body th { background: var(--bg-3); }
.markdown-body a { color: var(--accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.copy-code {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--bg-3);
    color: var(--fg-dim);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 4px 9px;
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}
.markdown-body pre:hover .copy-code { opacity: 1; }
.copy-code:hover { background: var(--accent); color: #000; }

.workflow-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.workflow-tag {
    background: rgba(182, 242, 90, 0.08);
    color: var(--accent);
    border: 1px solid rgba(182, 242, 90, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 10px;
}

.typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 8px 0; }
.typing-dots i {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--fg-muted); display: inline-block;
    animation: typing 1.2s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* Composer (chat) */
.composer {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    padding: 16px 24px 20px;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
    z-index: 10;
}
.composer__workflows {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
}
.wf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--fg-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}
.wf-chip:hover { border-color: var(--border-2); color: var(--fg-dim); }
.wf-chip svg { width: 12px; height: 12px; }
.wf-chip input[type="checkbox"] { accent-color: var(--accent); width: 12px; height: 12px; cursor: pointer; }
.wf-chip--toggle:has(input:checked) { background: rgba(182, 242, 90, 0.1); border-color: var(--accent); color: var(--accent); }
.wf-mini-select, .wf-mini-input {
    background: var(--bg-3);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    padding: 1px 4px;
    font-family: var(--mono);
}
.wf-mini-input { width: 36px; text-align: center; }
.wf-mini-select { padding: 2px 4px; }

.composer__input-wrap {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    max-width: 880px;
    margin: 0 auto;
    position: relative;
    transition: border-color 0.15s;
}
.composer__input-wrap:focus-within { border-color: var(--accent); }
.composer__input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--fg);
    font-family: var(--sans);
    font-size: 15px;
    resize: none;
    outline: none;
    min-height: 44px;
    line-height: 1.5;
    padding: 6px 4px;
}
.composer__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    gap: 12px;
}
.composer__counter { color: var(--fg-muted); font-family: var(--mono); font-size: 11px; }
.composer__counter.over { color: #ff6464; }
.composer__actions { display: flex; gap: 6px; align-items: center; }

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg-muted);
    width: 34px; height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg-3); color: var(--fg); }
.icon-btn svg { width: 17px; height: 17px; }

.btn-send {
    width: 36px; height: 36px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-send:hover:not(:disabled) { background: #d2ff7a; transform: scale(1.05); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-send svg { width: 16px; height: 16px; }

.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(182, 242, 90, 0.08);
    border: 2px dashed var(--accent);
    border-radius: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.drop-overlay--show { display: flex; }
.drop-overlay__inner { text-align: center; color: var(--accent); }
.drop-overlay__inner strong { display: block; margin-top: 8px; font-family: var(--serif); font-size: 18px; font-weight: 500; }

/* Tables (stats) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--fg-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; font-family: var(--mono); }
.table .num { text-align: right; font-family: var(--mono); }
.table .empty { text-align: center; color: var(--fg-muted); padding: 24px; }
.table tr:last-child td { border-bottom: none; }
.table a { color: var(--accent); text-decoration: none; }
.table a:hover { text-decoration: underline; }
.error-msg { color: #ff8a8a; font-family: var(--mono); font-size: 12px; }

/* Files page */
.storage-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.dropzone-card {
    border: 2px dashed var(--border);
    background: var(--bg);
    text-align: center;
    transition: all 0.2s;
}
.dropzone-card--active {
    border-color: var(--accent);
    background: rgba(182, 242, 90, 0.04);
}
.dropzone__inner { color: var(--fg-muted); padding: 20px; }
.dropzone__inner p { margin: 8px 0 0; }
.dropzone__inner small { color: var(--fg-muted); }

.file-tree { padding: 8px 0; }
.tree-empty { color: var(--fg-muted); padding: 24px; text-align: center; }
.file-item { padding: 0; }
.file-children {
    border-left: 1px dashed var(--border);
    margin-left: 14px;
    padding-left: 8px;
}
.file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.1s;
}
.file-row:hover { background: var(--bg-3); }
.file-toggle {
    background: none; border: none; color: var(--fg-muted);
    cursor: pointer; width: 18px; padding: 0;
    font-family: var(--mono); font-size: 10px;
}
.file-toggle--dot { cursor: default; opacity: 0.4; }
.file-icon { width: 16px; height: 16px; color: var(--fg-muted); flex-shrink: 0; }
.file-item--folder > .file-row .file-icon { color: var(--accent); }
.file-name { flex: 1; color: var(--fg-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--fg-muted); font-family: var(--mono); font-size: 11px; }
.file-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.file-row:hover .file-actions { opacity: 1; }
.file-actions button {
    background: transparent; border: none; color: var(--fg-muted);
    width: 24px; height: 24px; border-radius: 4px;
    cursor: pointer; font-size: 12px;
}
.file-actions button:hover { background: var(--bg); color: var(--fg); }

/* Modals */
.modal {
    position: fixed; inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal[hidden] { display: none; }
.modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.modal__body {
    position: relative;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    width: 90%;
    max-width: 420px;
}
.modal__body h3 { font-family: var(--serif); margin: 0 0 16px; font-weight: 500; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}
.pricing-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    flex-direction: column;
}
.pricing-card--featured {
    border-color: var(--accent);
    background: linear-gradient(145deg, rgba(182, 242, 90, 0.05), var(--bg-2));
    position: relative;
}
.pricing-card--current::after {
    content: 'Plan actuel';
    position: absolute;
    top: 12px; right: 12px;
    background: var(--bg-3);
    color: var(--fg-dim);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.pricing-card__header { margin-bottom: 20px; }
.pricing-card__tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    background: var(--bg-3);
    color: var(--fg-dim);
    padding: 3px 10px;
    border-radius: 100px;
    margin-bottom: 14px;
    letter-spacing: 0.06em;
}
.pricing-card__tag--premium { background: var(--accent); color: #000; }
.pricing-card__price {
    font-family: var(--serif);
    font-size: 42px;
    color: var(--fg);
    font-weight: 400;
    line-height: 1;
}
.pricing-card__price small { font-family: var(--sans); font-size: 14px; color: var(--fg-muted); margin-left: 4px; font-weight: 400; }
.pricing-card__sub { color: var(--fg-muted); font-size: 13px; margin: 8px 0 0; }
.pricing-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}
.pricing-card__features li {
    padding: 7px 0;
    color: var(--fg-dim);
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.pricing-card__features li.dim { color: var(--fg-muted); }
.pricing-card__features li:last-child { border-bottom: none; }

/* FAQ */
.faq details {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.faq details:last-child { border-bottom: none; }
.faq summary {
    cursor: pointer;
    color: var(--fg);
    font-weight: 500;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
    content: '+ ';
    color: var(--accent);
    font-family: var(--mono);
    font-weight: 600;
}
.faq details[open] summary::before { content: '− '; }
.faq details p { color: var(--fg-muted); margin: 8px 0 0; padding-left: 16px; font-size: 14px; line-height: 1.6; }

/* Flash messages */
.flash {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}
.flash--success { background: rgba(182, 242, 90, 0.1); border: 1px solid rgba(182, 242, 90, 0.3); color: var(--accent); }
.flash--warn { background: rgba(255, 200, 80, 0.08); border: 1px solid rgba(255, 200, 80, 0.25); color: #ffd07a; }
.flash--error { background: rgba(255, 100, 100, 0.08); border: 1px solid rgba(255, 100, 100, 0.25); color: #ff8a8a; }

/* Toasts */
.toast-stack {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: auto;
    max-width: 380px;
}
.toast--show { transform: translateX(0); opacity: 1; }
.toast--success { border-color: rgba(182, 242, 90, 0.4); }
.toast--error { border-color: rgba(255, 100, 100, 0.4); color: #ff9999; }
.toast--info { border-color: var(--border-2); }

/* Composer mobile */
@media (max-width: 880px) {
    .composer { left: 0; }
    .page-container { padding: 16px; }
    .topbar { padding: 0 16px; }
    .empty-state h1 { font-size: 32px; }
}

/* ============================================================
   Workflow bar (barre de sélecteurs sous la topbar du chat)
   ============================================================ */
.workflow-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 12px;
}
.workflow-bar .select--small {
  height: 30px;
  padding: 0 28px 0 10px;
  font-size: 12px;
  min-width: 130px;
  max-width: 200px;
}
.workflow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg);
  user-select: none;
  font-size: 12px;
}
.workflow-toggle input[type="checkbox"] {
  margin: 0;
}
.workflow-toggle small {
  color: var(--fg-muted);
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  margin-left: 2px;
}
.workflow-bar__manage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.workflow-bar__manage:hover {
  color: var(--fg);
  background: var(--bg);
}

/* ============================================================
   Bouton small + select small (variantes)
   ============================================================ */
.btn--small {
  padding: 6px 10px;
  font-size: 12px;
  height: auto;
}
.select--small {
  height: 30px;
  font-size: 12px;
  padding: 0 28px 0 10px;
}

/* ============================================================
   Page Workflows
   ============================================================ */
.page-container {
  padding: 24px 32px 60px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.page-intro {
  color: var(--fg-muted);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.6;
}
.wf-section {
  margin-bottom: 18px;
}
.wf-section__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.wf-section__head > div:first-child {
  flex: 1;
}
.wf-section__head .card__title {
  margin: 0 0 4px;
}
.wf-section__head .card__sub {
  margin: 0;
}
.wf-section__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Cartes individuelles de workflow */
.wf-row {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color .15s, background .15s;
}
.wf-row:hover {
  border-color: var(--accent-dim, var(--border));
}
.wf-row__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wf-row__head strong {
  font-size: 14px;
  color: var(--fg);
}
.wf-row__desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.wf-row__summary {
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--fg-muted);
  word-break: break-word;
}

/* ============================================================
   Smart Router : boutons de mode (Éco / Équilibré / Max)
   ============================================================ */
.wf-router-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.router-mode {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  height: 30px;
}
.router-mode[hidden] { display: none; }
.router-mode button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  padding: 0 10px;
  font-size: 11px;
  color: var(--fg-muted);
  cursor: pointer;
  height: 100%;
  font-family: var(--mono);
  letter-spacing: .02em;
  transition: background .15s, color .15s;
}
.router-mode button:last-child { border-right: 0; }
.router-mode button:hover {
  color: var(--fg);
  background: var(--bg-2);
}
.router-mode button.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

/* Ajuster la barre workflow quand elle est dans le composer */
.composer .workflow-bar {
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  padding: 8px 12px;
  margin-bottom: 0;
  background: var(--bg-2);
}
.composer .composer__input-wrap {
  border-radius: 0 0 12px 12px;
}

/* ============================================================
   Chart wrapper (Chart.js a besoin d'un parent à dimensions fixes
   pour ne pas s'auto-agrandir à chaque resize)
   ============================================================ */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  max-width: 100%;
}
.chart-wrap canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

/* ============================================================
   Pin / épingle conversations dans la sidebar
   ============================================================ */
.conv-item {
  position: relative;
  padding-right: 60px; /* place pour les 2 boutons */
}
.conv-item.pinned {
  background: rgba(182, 242, 90, 0.04);
  border-left: 2px solid var(--accent);
}
.conv-item__actions { display: flex; align-items: center; gap: 4px; }
.conv-item__pin-badge {
  margin-right: 4px;
  font-size: 11px;
  flex-shrink: 0;
}
.conv-item__pin,
.conv-item__delete {
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.conv-item:hover .conv-item__pin,
.conv-item:hover .conv-item__delete,
.conv-item.pinned .conv-item__pin {
  opacity: 0.7;
}
.conv-item__pin:hover {
  opacity: 1;
  color: var(--accent);
  background: var(--bg-2);
}
.conv-item__delete:hover {
  opacity: 1;
  color: var(--danger);
  background: var(--bg-2);
}
.conv-item.pinned .conv-item__pin {
  color: var(--accent);
  opacity: 1;
}

/* ============================================================
   Bibliothèque de fichiers (modale chat)
   ============================================================ */
.library-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  background: var(--bg-2);
}
.library-item > div:first-child { flex: 1; min-width: 0; }
.library-item strong {
  font-size: 13px;
  color: var(--fg);
  display: block;
  word-break: break-word;
}

/* ============================================================
   Badge "fichier joint" au-dessus du composer
   ============================================================ */
.attachment-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: 8px 8px 0 0;
  border-bottom: 0;
  font-size: 13px;
  color: var(--fg);
}
.attachment-badge strong {
  font-family: var(--mono);
  font-size: 12px;
}
.attachment-badge .icon-btn {
  width: 24px; height: 24px;
  font-size: 18px;
  line-height: 1;
}

/* ============================================================
   Bouton "Sauvegarder dans le fichier" sur les blocs de code
   proposés par l'IA pour modifier un fichier joint.
   ============================================================ */
.file-save-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(182, 242, 90, 0.08);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 13px;
}
.file-save-prompt strong {
  font-family: var(--mono);
  color: var(--accent);
}

/* ============================================================
   Indicateur quota workflow (cards désactivées si free + plein)
   ============================================================ */
.wf-section--locked .wf-section__list {
  opacity: 0.6;
  pointer-events: none;
}
.wf-quota-notice {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(182, 242, 90, 0.05);
  border: 1px dashed var(--accent);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}
.wf-quota-notice a { color: var(--accent); }

/* Input color pour la personnalisation thématique */
.input--color {
  width: 50px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: none;
}
.input--color::-webkit-color-swatch-wrapper {
  padding: 0;
}
.input--color::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius);
}
.input--color::-moz-color-swatch {
  border: none;
  border-radius: var(--radius);
}
  
/* ============================================================  
  Stats boxes (premium-stats.html)  
  ============================================================ */  
  
.stat-box {  
    background: var(--bg-2);  
    border: 1px solid var(--border);  
    border-radius: var(--radius);  
    padding: 16px;  
    min-width: 160px;  
}  
  
.stat-box__label {  
    color: var(--fg-muted);  
    font-size: 11px;  
    text-transform: uppercase;  
    letter-spacing: 0.08em;  
    margin-bottom: 8px;  
    font-family: var(--mono);  
} 
  
.stat-box__value {  
    font-family: var(--mono);  
    font-size: 28px;  
    color: var(--accent);  
    font-weight: 600;  
    margin-bottom: 4px;  
}  
  
.stat-box__sub {  
    color: var(--fg-muted);  
    font-size: 12px;  
    font-family: var(--mono);  
}  
  
.stat-row {  
    display: flex;  
    justify-content: space-between;  
    align-items: center;  
    padding: 8px 0;  
    border-bottom: 1px solid var(--border);  
} 
