/* Thème Click Army : fond sombre, accent orange, touches cyan, police Oxanium pour les titres. */
@font-face { font-family: Oxanium; src: url('/oxanium-latin.woff2') format('woff2'); font-style: normal; font-weight: 400 700; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #070c14;
  --surface: #0d1723;
  --panel: #101d2a;
  --panel-2: #142331;
  --border: #2a4151;
  --border-strong: #3d5868;
  --text: #edf5f8;
  --muted: #a9bdc9;
  --primary: #ff6848;
  --primary-hover: #ff866b;
  --on-primary: #1d1010;
  --teal: #66dce6;
  --danger: #ff7b72;
  --ok: #4ade80;
  --warn: #fbbf24;
  --radius: 10px;
  --display: Oxanium, "Segoe UI", sans-serif;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
* { box-sizing: border-box; }
html { scrollbar-color: #355269 #08121e; }
body { margin: 0; background: var(--bg); caret-color: var(--teal); }
::selection { background: var(--primary); color: #100d12; }
:focus-visible { outline: 2px solid #8ce8ef; outline-offset: 2px; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: #9cf0f5; text-decoration: underline; }
h1 { font: 700 26px/1.2 var(--display); letter-spacing: -.01em; margin: 0 0 6px; color: #f2fbfc; }
h1::after { content: ""; display: block; width: 40px; height: 3px; margin-top: 10px; background: var(--primary); }
h1.plain::after { display: none; }
h2 { font: 650 16px/1.3 var(--display); margin: 0 0 12px; color: #ecf9fa; }
h3 { font: 600 14px/1.3 var(--display); margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* layout */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { position: relative; background: #0a1420; border-right: 1px solid #2d4655; padding: 18px 12px; display: flex; flex-direction: column; gap: 3px; }
.sidebar::after { content: ""; position: absolute; top: 0; right: -1px; width: 1px; height: 190px; background: linear-gradient(var(--teal), transparent); }
.sidebar .brand { padding: 2px 8px 6px; }
.sidebar .brand img { width: 170px; height: auto; display: block; }
.sidebar .app-name { font: 600 11px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--teal); padding: 0 10px 16px; }
.sidebar a { color: #c4d6de; padding: 9px 12px; border-radius: 8px; display: flex; align-items: center; gap: 8px; border-left: 2px solid transparent; }
.sidebar a:hover { background: #122937; color: #fff; text-decoration: none; }
.sidebar a.active { background: #142b3a; color: #fff; border-left-color: var(--primary); }
.sidebar .count { margin-left: auto; background: var(--primary); color: var(--on-primary); border-radius: 999px; font: 700 11px var(--display); padding: 1px 7px; }
.sidebar .spacer { flex: 1; }
.sidebar .me { padding: 10px 12px; font-size: 12px; color: #8ea8b5; border-top: 1px solid var(--border); margin-top: 6px; }
.sidebar .me strong { color: var(--text); display: block; font-size: 13px; }
.main { padding: 30px 34px; min-width: 0; background: radial-gradient(ellipse 80% 30% at 10% -10%, rgba(26, 95, 123, .18), transparent 70%); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* panels */
.panel { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel.accent::before { content: ""; position: absolute; top: -1px; left: 18px; width: 70px; height: 2px; background: var(--teal); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 9px; color: var(--text); transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--primary); text-decoration: none; color: var(--text); transform: translateY(-1px); }
.card strong { font: 650 15px var(--display); }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; min-width: 140px; color: var(--muted); font-size: 12px; }
.stat b { display: block; font: 700 26px var(--display); color: var(--text); }
.stat.hot b { color: var(--primary); }

progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 4px; background: #1d3242; overflow: hidden; }
progress::-webkit-progress-bar { background: #1d3242; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--primary), #ffa36b); }
progress::-moz-progress-bar { background: var(--primary); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #345063; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { position: relative; padding: 10px 14px 12px; color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs a:hover { text-decoration: none; color: #ebf8f8; background: #122937; }
.tabs a.active { color: #83e8ee; }
.tabs a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--teal); }
.tabs .count { color: var(--primary); font-family: var(--display); margin-left: 4px; }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid #22394a; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font: 600 11px var(--display); color: #8fb3c0; text-transform: uppercase; letter-spacing: .06em; background: #0d1925; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #152a39; }
tr.done td.title { text-decoration: line-through; color: var(--muted); }
td.title .indent { display: inline-block; color: #4d6b7c; text-align: right; padding-right: 6px; }
.indent.d1 { width: 22px; } .indent.d2 { width: 40px; } .indent.d3 { width: 58px; } .indent.d4 { width: 76px; } .indent.d5 { width: 94px; } .indent.d6 { width: 112px; }
td.title .icons { margin-left: 6px; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }

/* forms */
.btn { border: 1px solid #3d5b6a; background: #101f2b; color: #dcf1f4; padding: 8px 15px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 650; transition: background-color .2s, border-color .2s; }
.btn:hover { background: #193142; border-color: #6dbfcb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #6b3434; }
.btn.danger:hover { background: #3a1c1c; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.link { border: 0; background: none; color: var(--teal); padding: 0; font-weight: 400; }
.btn.link:hover { text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
form.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #c4dbe2; font-weight: 650; letter-spacing: .01em; }
label.check { flex-direction: row; align-items: center; font-weight: 400; color: var(--text); font-size: 13px; gap: 6px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0; }
legend { font: 600 12px var(--display); color: var(--teal); padding: 0 6px; letter-spacing: .04em; }
input, select, textarea { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid #365164; border-radius: 8px; background: #0b1722; color: var(--text); }
input::placeholder, textarea::placeholder { color: #7f98a6; }
input:hover, select:hover, textarea:hover { border-color: #5b8796; }
select option { background: #0b1722; color: var(--text); }
input[type=checkbox] { accent-color: var(--primary); width: 15px; height: 15px; }
input[type=date] { color-scheme: dark; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(102, 220, 230, .35); border-color: var(--teal); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input { min-width: 220px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 180px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #0b1722; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 650; background: #1e3242; color: #b9cfd8; white-space: nowrap; border: 1px solid transparent; }
.badge.todo, .badge.open { background: #1e3242; color: #c4d6de; }
.badge.in_progress, .badge.active { background: rgba(102, 220, 230, .12); color: #83e8ee; border-color: rgba(102, 220, 230, .3); }
.badge.review, .badge.on_hold, .badge.resolved { background: rgba(251, 191, 36, .12); color: #fcd34d; border-color: rgba(251, 191, 36, .3); }
.badge.done, .badge.completed, .badge.closed { background: rgba(74, 222, 128, .12); color: #86efac; border-color: rgba(74, 222, 128, .3); }
.badge.archived, .badge.low, .badge.minor { background: #18232e; color: #8ea3ae; }
.badge.medium { background: rgba(102, 220, 230, .1); color: #9fe7ee; }
.badge.high, .badge.major { background: rgba(255, 104, 72, .14); color: #ffab95; border-color: rgba(255, 104, 72, .35); }
.badge.urgent, .badge.critical { background: rgba(255, 104, 72, .28); color: #ffd0c4; border-color: var(--primary); }
.badge.blocker { background: var(--primary); color: var(--on-primary); }
.badge.cancelled { background: #18232e; color: #8ea3ae; text-decoration: line-through; }
.badge.blocked { background: #3a1c1c; color: #ffb4ae; border-color: #6b3434; }
.overdue { color: var(--danger); font-weight: 650; }

/* kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.column { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 220px; }
.column.drag-over { outline: 2px dashed var(--primary); }
.column h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #9fc3cf; margin: 2px 2px 12px; display: flex; justify-content: space-between; }
.kcard { background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid #36566a; border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.kcard.p-high, .kcard.p-urgent { border-left-color: var(--primary); }
.kcard:hover { border-color: var(--teal); }
.kcard.dragging { opacity: .5; }
.kcard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.kcard .parent { font-size: 11px; color: var(--muted); }

/* feeds */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 9px 0; border-bottom: 1px solid #22394a; }
.feed li:last-child { border-bottom: 0; }
.feed li.unread { border-left: 2px solid var(--primary); padding-left: 10px; background: linear-gradient(90deg, rgba(255, 104, 72, .07), transparent 60%); }
.feed .clickable { cursor: pointer; }
.feed .clickable:hover { background: #132634; }
.comment-body { white-space: pre-wrap; margin-top: 4px; }
.links { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 4px; }
.links li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.section-title h2 { margin: 0; }
.notice { border: 1px solid #6b3434; background: #2a1517; color: #ffc9c3; border-radius: 8px; padding: 9px 12px; }
.notice.info { border-color: #2f5868; background: #0f2430; color: #c8eef2; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 12, .72); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 10; }
.modal { position: relative; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 13px; width: 100%; max-width: 820px; padding: 22px 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.modal::before { content: ""; position: absolute; top: -1px; left: 24px; width: 90px; height: 2px; background: var(--primary); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.close { border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.close:hover { color: var(--text); }

/* auth */
.auth { max-width: 420px; margin: 9vh auto; padding: 0 16px; }
.auth .logo { width: 220px; display: block; margin: 0 0 26px; }
.auth .panel { padding: 26px; }
.auth .tagline { font: 600 11px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; }
.error { color: var(--danger); font-size: 13px; }

.toast { position: fixed; bottom: 20px; right: 20px; background: #142b3a; border: 1px solid var(--teal); color: #fff; padding: 11px 16px; border-radius: 9px; z-index: 20; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.toast.error { background: #3a1c1c; border-color: var(--danger); }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.drop { border: 1px dashed #3d5b6a; border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drop.over { border-color: var(--primary); background: rgba(255, 104, 72, .06); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar::after, .sidebar .app-name, .sidebar .spacer { display: none; }
  .sidebar .brand img { width: 130px; }
  .sidebar .me { border: 0; margin: 0; }
  .main { padding: 18px; }
}
