:root {
  --bg: #0c0a06; --bg2: #100d08; --panel: #16120a; --panel2: #1c170d;
  --line: #2e2512; --line2: #3d3118;
  --gold: #c9a548; --gold-hi: #e6c76e; --gold-dim: #8a7233;
  --ink: #f3e9d2; --ink2: #c7b68c; --ink3: #8d7d55;
  --up: #4ade80; --down: #f87171; --warn: #fbbf24;
  --r: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  font-size: 15px; line-height: 1.5; min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(201, 165, 72, .10), transparent 60%),
    radial-gradient(700px 600px at -10% 110%, rgba(201, 165, 72, .05), transparent 55%);
}
.mono { font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace; }
h1, h2, .display { font-family: "Fraunces", Georgia, serif; font-weight: 650; letter-spacing: .2px; }
a { color: inherit; }

/* ===== layout ===== */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: 232px; flex: none; background: linear-gradient(180deg, #0a0805, #0d0a05);
  border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; text-decoration: none; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: conic-gradient(from 210deg, #e6c76e, #9a7c2e, #e6c76e, #6b5420, #e6c76e);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 22px rgba(201, 165, 72, .35);
}
.brand .mark span { font-family: "Fraunces", Georgia, serif; font-size: 21px; color: #171003; font-weight: 650; }
.brand b { font-family: "Fraunces", Georgia, serif; font-size: 17px; font-weight: 650; display: block; line-height: 1.1; }
.brand small { color: var(--gold); font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink2); cursor: pointer; font-weight: 500; font-size: 14px; border: 1px solid transparent;
  text-decoration: none; transition: all .18s;
}
.nav-item:hover { color: var(--ink); background: rgba(201, 165, 72, .06); }
.nav-item.active {
  color: var(--gold-hi); background: linear-gradient(90deg, rgba(201, 165, 72, .13), rgba(201, 165, 72, .03));
  border-color: rgba(201, 165, 72, .25);
}
.side-foot { margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--up); box-shadow: 0 0 8px var(--up); margin-right: 7px; }

.content { flex: 1; min-width: 0; padding: 26px 34px 60px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.chip { font-size: 12px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line2); color: var(--ink2); background: var(--panel); }
.chip.gold { color: var(--gold-hi); border-color: rgba(201, 165, 72, .4); }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 30px; }
.page-head p { color: var(--ink2); font-size: 14px; margin-top: 3px; }

/* ===== cards ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat .k { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink3); margin-bottom: 7px; }
.stat .v { font-size: 24px; font-weight: 600; font-family: "IBM Plex Mono", monospace; }
.up-t { color: var(--up); } .down-t { color: var(--down); }

.panel { background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 14px; }
.panel h2 { font-size: 18px; margin-bottom: 14px; }

/* ===== forms ===== */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink3); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; background: #0e0b06; border: 1px solid var(--line2); border-radius: 10px; color: var(--ink);
  padding: 11px 13px; font-size: 14.5px; font-family: "IBM Plex Mono", monospace; outline: none;
}
.input:focus { border-color: var(--gold-dim); }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 10px;
  font-family: "Outfit", sans-serif; font-size: 13.5px; font-weight: 600; cursor: pointer; border: none;
  transition: transform .15s, box-shadow .15s; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(135deg, #e6c76e, #b8913a); color: #1b1204; box-shadow: 0 2px 14px rgba(201, 165, 72, .25); }
.btn-gold:hover { box-shadow: 0 4px 22px rgba(201, 165, 72, .45); }
.btn-ghost { background: transparent; color: var(--ink2); border: 1px solid var(--line2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--gold-dim); }
.btn-danger { background: rgba(248, 113, 113, .1); color: var(--down); border: 1px solid rgba(248, 113, 113, .35); }
.btn-danger:hover { background: rgba(248, 113, 113, .18); }

/* ===== table ===== */
table { width: 100%; border-collapse: collapse; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--ink3); text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line2); font-weight: 600; }
td { padding: 11px 10px; font-size: 13px; border-bottom: 1px solid var(--line); color: var(--ink2); }
td.mono { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; }
tr:hover td { background: rgba(201, 165, 72, .03); }

/* ===== flash messages ===== */
.flash { border-radius: 12px; padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; margin-bottom: 18px; }
.flash-ok { border: 1px solid rgba(74, 222, 128, .3); background: rgba(74, 222, 128, .05); color: var(--up); }
.flash-warn { border: 1px solid rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .06); color: var(--warn); }
.flash-error { border: 1px solid rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .06); color: var(--down); }

/* ===== strategy cards (Tâche 7) ===== */
.strats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.scard {
  background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px; transition: border-color .2s, transform .2s; position: relative; overflow: hidden;
}
.scard:hover { border-color: rgba(201, 165, 72, .45); transform: translateY(-2px); }
.scard .head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.sicon {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
  font-family: "Fraunces", serif; font-weight: 650; font-size: 15px; color: #1b1204;
  background: linear-gradient(135deg, #e6c76e, #8a7233);
}
.scard .head b { font-size: 15px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { font-size: 10.5px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line2); color: var(--ink2); }
.tag.gold { color: var(--gold-hi); border-color: rgba(201, 165, 72, .35); }
.srow { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; gap: 10px; }
.srow .m .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink3); }
.srow .m .v { font-size: 16px; font-weight: 600; font-family: "IBM Plex Mono", monospace; }
.sfoot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.sfoot .risk { font-size: 11.5px; color: var(--ink2); }
.sfoot .fol { font-size: 11.5px; color: var(--ink2); margin-left: auto; }
.muted { color: var(--ink3); }

/* ===== filters ===== */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.fbtn {
  font-size: 12.5px; padding: 7px 15px; border-radius: 99px; border: 1px solid var(--line2);
  background: transparent; color: var(--ink2); cursor: pointer; font-family: "Outfit", sans-serif; font-weight: 500;
  text-decoration: none; display: inline-block;
}
.fbtn.on { background: linear-gradient(135deg, rgba(230, 199, 110, .18), rgba(201, 165, 72, .08)); color: var(--gold-hi); border-color: rgba(201, 165, 72, .45); }

/* ===== footer ===== */
.site-footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink3); }

@media (max-width: 920px) {
  .sidebar { width: 64px; padding: 18px 8px; }
  .brand b, .brand small, .nav-item span, .side-foot { display: none; }
  .brand { justify-content: center; padding-bottom: 16px; }
  .nav-item { justify-content: center; }
  .content { padding: 20px 16px 60px; }
}
