/* Claude Famille — feuille de style commune */
:root {
  --bg: #FAF9F5;
  --bg-2: #F0EEE6;
  --bg-3: #E8E6DC;
  --card: #FFFFFF;
  --text: #2B2A25;
  --text-2: #6B6960;
  --text-3: #9C9A90;
  --line: #E3E0D6;
  --accent: #C96442;
  --accent-2: #B5522F;
  --accent-soft: #F6E4DC;
  --ok: #4F8A4B;
  --ok-soft: #E3F0E1;
  --warn: #B8860B;
  --warn-soft: #F8EFD3;
  --danger: #B3413A;
  --danger-soft: #F7E1DF;
  --radius: 14px;
  --serif: "Lora", "Georgia", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
h1 { font-size: 30px; margin: 0 0 8px; }
h2 { font-size: 22px; margin: 0 0 6px; }
h3 { font-size: 17px; margin: 0 0 4px; }
p { margin: 0 0 10px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--text-3); }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.center { text-align: center; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-weight: 500; transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--danger); border-color: #E8C8C5; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Formulaires */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=time], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 22px; background: var(--bg-3); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { left: 21px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-2); color: var(--text-2); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.accent { background: var(--accent-soft); color: var(--accent-2); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.avatar.lg { width: 72px; height: 72px; font-size: 30px; }

.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--warn-soft); color: #7A5A00; }

.progress { height: 8px; border-radius: 8px; background: var(--bg-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 8px; transition: width .3s; }
.progress.ok > div { background: var(--ok); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--text-2); font-weight: 600; }

/* Markdown rendu */
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; font-family: var(--sans); font-weight: 700; }
.md h1 { font-size: 20px; } .md h2 { font-size: 18px; } .md h3 { font-size: 16px; }
.md ul, .md ol { margin: 6px 0 10px; padding-left: 24px; }
.md li { margin: 3px 0; }
.md code { font-family: var(--mono); font-size: 13px; background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: #2B2A25; color: #F2F0E8; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.md pre code { background: none; padding: 0; color: inherit; }
.md blockquote { margin: 8px 0; padding: 4px 14px; border-left: 3px solid var(--line); color: var(--text-2); }
.md table { border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 9px; }
.md img { max-width: 100%; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* Page centrée (setup, connexion) */
.page-center { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.page-center .card { width: 100%; max-width: 440px; padding: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; }
.brand .logo { width: 30px; height: 30px; }
.brand .fam { font-size: 12px; font-family: var(--sans); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-top: 6px; }
