/* SKELD CRM — charte SKELD : noir #121212, dégradé #F27C26 → #E2332A → #A11585,
   Inter Tight (titres) + Manrope (lecture). */

@font-face { font-family: "Inter Tight"; src: url("assets/fonts/InterTight-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("assets/fonts/InterTight-Italic-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("assets/fonts/Manrope-VariableFont_wght.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }

:root {
  --orange: #f27c26; --red: #e2332a; --magenta: #a11585; --black: #121212;
  --grad: linear-gradient(90deg, #f27c26 0%, #e2332a 40%, #a11585 80%);
  --grad-v: linear-gradient(180deg, #f27c26 0%, #e2332a 40%, #a11585 80%, #121212 100%);
  --won: #8bd400; --lost: #ef3340; --warn: #f2b726; --info: #0595ff;

  --bg: #121212; --surface: #1a1a1a; --surface-2: #222222; --surface-3: #2a2a2a;
  --border: #2e2e2e; --border-strong: #3d3d3d;
  --text: #f4f4f4; --text-2: #c4c4c4; --muted: #8c8c8c;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --focus: 0 0 0 2px #121212, 0 0 0 4px #f27c26;
  --logo: url("assets/logo_color_white.svg");
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f4f4; --surface: #ffffff; --surface-2: #f6f6f6; --surface-3: #ececec;
  --border: #e3e3e3; --border-strong: #cfcfcf;
  --text: #121212; --text-2: #3a3a3a; --muted: #6f6f6f;
  --shadow: 0 8px 28px rgba(18,18,18,.12);
  --focus: 0 0 0 2px #fff, 0 0 0 4px #e2332a;
  --logo: url("assets/logo_color_black.svg");
  --won: #5c9a00;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.45 Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .t { font-family: "Inter Tight", Manrope, sans-serif; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--orange); }
a.link:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hidden, [hidden] { display: none !important; }

/* ---------- shell */
.app { display: grid; grid-template-columns: 64px 1fr; height: 100vh; }
.rail { background: #0b0b0b; border-right: 1px solid #1f1f1f; display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px; position: relative; z-index: 5; }
:root[data-theme="light"] .rail { background: #121212; }
.rail .mono { width: 36px; height: 36px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; margin-bottom: 14px; }
.rail .mono img { width: 22px; }
.rail a, .rail button { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #8f8f8f; position: relative; background: none; border: 0; cursor: pointer; }
.rail a:hover, .rail button:hover { color: #fff; background: #1d1d1d; }
.rail a.active { color: #fff; background: #222; }
.rail a.active::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad-v); }
.rail a[data-tip]:hover::after, .rail button[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 52px; top: 50%; transform: translateY(-50%); background: #262626; color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }
.rail .spacer { flex: 1; }
.rail .badge { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { height: 60px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar .logo { width: 104px; height: 17px; background: var(--logo) no-repeat left center / contain; flex: none; }
.topbar .sep { width: 1px; height: 22px; background: var(--border); }
.topbar .title { font-family: "Inter Tight"; font-weight: 700; font-size: 16px; white-space: nowrap; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input { width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 12px 0 36px; }
.search input::placeholder { color: var(--muted); }
.search > svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.tax-switch .btn { min-width: 44px; font-family: "Inter Tight"; letter-spacing: .02em; }
.btn-group.tax-switch .btn.on { background: var(--grad); color: #fff; border-color: transparent; }
.search kbd { position: absolute; right: 9px; top: 8px; font: 600 11px Manrope; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; }
.search-results { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; padding: 6px; z-index: 30; }
.search-results .grp { font: 700 11px Manrope; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.search-results a:hover, .search-results a.sel { background: var(--surface-3); }
.content { flex: 1; overflow: auto; min-height: 0; }
.page { padding: 22px 24px 40px; }

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border: 0; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.won { background: var(--won); border-color: transparent; color: #121212; }
.btn.lost { background: var(--lost); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; margin: 0; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }
.btn-group .btn.on { background: var(--surface-3); color: var(--orange); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.input, select.input, textarea.input { height: 36px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); padding: 0 10px; width: 100%; }
textarea.input { height: auto; min-height: 90px; padding: 9px 10px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--orange); outline: none; box-shadow: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.toolbar .stat { font-family: "Inter Tight"; font-weight: 700; }
.toolbar .grow { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip.won { background: color-mix(in srgb, var(--won) 18%, transparent); color: var(--won); }
.chip.lost { background: color-mix(in srgb, var(--lost) 18%, transparent); color: var(--lost); }
.chip.open { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.grad { background: var(--grad); color: #fff; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sector { font-family: "Inter Tight"; font-style: italic; font-weight: 800; font-size: 12px; }
.sector.isecure { color: #ef0022; } .sector.icare { color: #0595ff; } .sector.ispace { color: #972ee4; }
.sector.ilogistics { color: #fe6200; } .sector.ifactory { color: #9bd600; }

/* ---------- kanban */
.board-wrap { display: flex; flex-direction: column; height: 100%; }
.board { flex: 1; display: flex; gap: 0; overflow-x: auto; min-height: 0; padding: 0 0 0 0; }
.col { flex: 1 0 272px; max-width: 340px; display: flex; flex-direction: column; border-right: 1px solid var(--border); min-height: 0; }
.col-head { padding: 12px 14px 10px; position: relative; background: var(--surface); border-bottom: 1px solid var(--border); }
.col-head h3 { font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.col-head .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.col-head .prob { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--grad); }
.col-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: background .15s; }
.col-body.over { background: color-mix(in srgb, var(--orange) 7%, transparent); }
.col-add { color: var(--muted); border: 1px dashed var(--border-strong); background: none; border-radius: 10px; height: 34px; cursor: pointer; font-weight: 700; font-size: 12px; flex: none; }
.col-add:hover { color: var(--text); border-color: var(--orange); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: grab; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card.dragging { opacity: .4; }
.card.done { opacity: .72; }
.card.done:hover { opacity: 1; }
.bill { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.bill-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.bill .bar { height: 8px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.bill .bar i { display: block; height: 100%; background: var(--grad); border-radius: 5px; }
.bill-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.warn-txt { color: var(--warn); }
.ttc-note { font-size: 11px; font-weight: 500; }
.card.rotting { border-left: 3px solid var(--lost); padding-left: 10px; }
.card .ttl { font-weight: 700; font-size: 13.5px; line-height: 1.3; padding-right: 22px; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.card .val { font-family: "Inter Tight"; font-weight: 700; font-size: 13px; }
.card .act-ind { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; background: transparent; }
.act-ind.ok { color: var(--won); }
.act-ind.today { color: var(--won); background: color-mix(in srgb, var(--won) 15%, transparent); }
.act-ind.late { color: var(--lost); background: color-mix(in srgb, var(--lost) 15%, transparent); }
.act-ind.none { color: var(--warn); }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; font: 800 10px "Inter Tight"; display: inline-grid; place-items: center; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; border-radius: 12px; }
.avatar.org { border-radius: 7px; background: var(--surface-3); color: var(--text-2); }
.avatar.org.lg { border-radius: 12px; }

.dropbar { position: fixed; left: 64px; right: 0; bottom: 0; height: 84px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 12px 20px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); transform: translateY(100%); transition: transform .2s; z-index: 20; }
.dropbar.show { transform: none; }
.dropbar div { border: 2px dashed var(--border-strong); border-radius: 12px; display: grid; place-items: center; font: 800 15px "Inter Tight"; color: var(--muted); transition: all .15s; }
.dropbar div.over { color: #fff; border-style: solid; }
.dropbar .d-won.over { background: var(--won); border-color: var(--won); color: #121212; }
.dropbar .d-lost.over { background: var(--lost); border-color: var(--lost); }
.dropbar .d-del.over { background: #555; border-color: #555; }
.dropbar .d-move.over { background: var(--grad); border-color: transparent; }

/* ---------- tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font: 700 11px Manrope; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; white-space: nowrap; cursor: default; }
.tbl th[data-sort] { cursor: pointer; }
.tbl th[data-sort]:hover { color: var(--text); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.clickable { cursor: pointer; }
.tbl .r { text-align: right; }
.tbl .name { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.tbl tr.done td { color: var(--muted); }
.tbl tr.done .subj { text-decoration: line-through; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: none; cursor: pointer; display: grid; place-items: center; padding: 0; color: transparent; }
.check:hover { border-color: var(--won); }
.check.on { background: var(--won); border-color: var(--won); color: #121212; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 16px; }

/* ---------- page header & tabs */
.ph { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ph .grow { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 10px 12px; font-weight: 700; color: var(--muted); cursor: pointer; position: relative; display: flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--grad); border-radius: 2px; }
.tabs .n { font-size: 11px; background: var(--surface-3); border-radius: 9px; padding: 0 6px; color: var(--text-2); }

/* ---------- detail */
.detail-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 24px 16px; position: relative; overflow: hidden; }
.detail-head::before { content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 260px; background: url("assets/pattern_white.png") center / 260px auto; opacity: .035; pointer-events: none; }
:root[data-theme="light"] .detail-head::before { filter: invert(1); opacity: .05; }
.detail-head .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.detail-head .row1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-head h1 { font-size: 24px; }
.detail-head .facts { display: flex; gap: 18px; margin-top: 8px; color: var(--text-2); font-size: 13px; flex-wrap: wrap; align-items: center; }
.detail-head .facts span { display: inline-flex; gap: 6px; align-items: center; }
.detail-head .facts .big { font: 800 18px "Inter Tight"; color: var(--text); }
.stagebar { display: flex; margin-top: 14px; gap: 3px; }
.stagebar button { flex: 1; height: 30px; border: 0; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 700; cursor: pointer; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); padding: 0 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.stagebar button:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stagebar button:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 9px 50%); border-radius: 0 6px 6px 0; }
.stagebar button.past { background: color-mix(in srgb, var(--red) 55%, var(--surface-3)); color: #fff; }
.stagebar button.cur { background: var(--grad); color: #fff; }
.stagebar button:hover:not(.cur) { filter: brightness(1.2); }
.stagebar .days { font-weight: 500; opacity: .8; margin-left: 4px; }

.detail-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; padding: 20px 24px 40px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.panel > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 8px; }
.panel > header h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.panel .body { padding: 14px 16px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 2px 10px; align-items: center; }
.kv dt { color: var(--muted); font-size: 12.5px; padding: 6px 0; }
.kv dd { margin: 0; min-height: 32px; display: flex; align-items: center; }
.editable { border-radius: 6px; padding: 4px 6px; margin-left: -6px; cursor: text; min-width: 60px; width: 100%; border: 1px solid transparent; }
.editable:hover { border-color: var(--border-strong); background: var(--surface-2); }
.editable.placeholder { color: var(--muted); }
.kv .input { height: 32px; }
h1.editable { width: auto; min-width: 0; margin-left: -6px; }

.composer { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px; }
.composer .tabs { margin: 0; padding: 0 10px; }
.composer .body { padding: 14px; }
.composer .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.type-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.type-pick button { width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.type-pick button.on { border-color: var(--orange); color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }

.tl-sec { font: 700 11px Manrope; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 10px; }
.tl { position: relative; padding-left: 34px; }
.tl::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 12px; }
.tl-item .ic { position: absolute; left: -34px; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); border: 3px solid var(--bg); }
.tl-item.note .ic { background: #3a2f12; color: var(--warn); }
.tl-item.pennylane .ic { background: var(--grad); color: #fff; }
.tl-item .box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.tl-item.note .box { background: color-mix(in srgb, var(--warn) 6%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 25%, var(--border)); }
.tl-item.event .box { background: transparent; border: 0; padding: 12px 0 0; color: var(--text-2); font-size: 13px; }
.tl-item .when { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.tl-item .txt { white-space: pre-wrap; }
.tl-item .tools { position: absolute; right: 8px; top: 8px; display: none; gap: 4px; }
.tl-item:hover .tools { display: flex; }
.act-row { display: flex; gap: 10px; align-items: flex-start; }
.act-row .grow { flex: 1; min-width: 0; }
.late-txt { color: var(--lost); font-weight: 700; }
.today-txt { color: var(--won); font-weight: 700; }

.line-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.line-items td, .line-items th { padding: 7px 4px; border-bottom: 1px solid var(--border); }
.line-items th { font-size: 11px; color: var(--muted); text-align: left; font-weight: 700; }
.line-items .r { text-align: right; }
.line-items input { width: 100%; height: 28px; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 0 5px; text-align: right; }
.line-items input:hover, .line-items input:focus { border-color: var(--border-strong); background: var(--surface-2); outline: none; }
.total-row { display: flex; justify-content: space-between; padding: 10px 4px 0; font-weight: 800; font-family: "Inter Tight"; }

.pl-card { border-radius: 12px; padding: 1px; background: var(--grad); margin-bottom: 16px; }
.pl-card > div { background: var(--surface); border-radius: 11px; }
.pl-logo { display: inline-flex; align-items: center; gap: 7px; font: 800 13px "Inter Tight"; }
.pl-logo i { width: 18px; height: 18px; border-radius: 5px; background: #11c39f; display: inline-block; position: relative; }
.pl-logo i::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.doc-row:last-child { border-bottom: 0; }
.status.paid { color: var(--won); } .status.late { color: var(--lost); } .status.upcoming { color: var(--info); } .status.draft { color: var(--muted); }

/* ---------- insights */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; position: relative; overflow: hidden; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 700; }
.kpi .v { font: 800 26px "Inter Tight"; margin-top: 4px; letter-spacing: -.02em; }
.kpi .s { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.kpi.accent::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart { padding: 14px 16px 10px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font: 600 10.5px Manrope; }
.chart .gridline { stroke: var(--border); }
.funnel-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 13px; }
.funnel-row .bar { height: 22px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.funnel-row .bar i { display: block; height: 100%; background: var(--grad); border-radius: 6px; min-width: 2px; }
.tip { position: fixed; pointer-events: none; background: #262626; color: #fff; padding: 6px 9px; border-radius: 7px; font-size: 12px; z-index: 100; box-shadow: var(--shadow); }

/* ---------- focus (détail d'une statistique) */
button.kpi { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, transform .1s, box-shadow .15s; }
button.kpi:hover { border-color: var(--orange); box-shadow: var(--shadow); }
button.kpi:active { transform: translateY(1px); }
.kpi-go { position: absolute; right: 12px; top: 14px; color: var(--muted); opacity: 0; transition: opacity .15s, transform .15s; }
button.kpi:hover .kpi-go { opacity: 1; transform: translateX(2px); color: var(--orange); }
.funnel-row.drill { cursor: pointer; border-radius: 8px; padding: 3px 6px; margin-left: -6px; margin-right: -6px; }
.funnel-row.drill:hover { background: var(--surface-2); }
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); z-index: 45; animation: fade .15s; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(900px, 100%); background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer-bg.closing { opacity: 0; transition: opacity .15s; }
.drawer > header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.drawer-body { flex: 1; overflow: auto; padding: 20px; }
.focus-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; position: relative; overflow: hidden; }
.focus-hero::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.focus-hero::before { content: ""; position: absolute; right: -30px; top: 0; bottom: 0; width: 220px; background: url("assets/pattern_white.png") center / 220px auto; opacity: .035; pointer-events: none; }
:root[data-theme="light"] .focus-hero::before { filter: invert(1); opacity: .05; }
.focus-hero .lbl { font-weight: 700; color: var(--text-2); font-size: 13px; }
.focus-hero .big { font: 800 44px/1.1 "Inter Tight"; letter-spacing: -.03em; margin: 6px 0 10px; }
.focus-facts { display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.focus-facts b { color: var(--text); font-family: "Inter Tight"; font-size: 15px; }
.drawer .tbl td:first-child { white-space: normal; min-width: 200px; }
.drawer .tbl td, .drawer .tbl th { padding-left: 10px; padding-right: 10px; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th.sortable::after { content: "↕"; margin-left: 5px; opacity: .35; font-size: 10px; }
.tbl th[data-dir="asc"]::after { content: "↑"; opacity: 1; color: var(--orange); }
.tbl th[data-dir="desc"]::after { content: "↓"; opacity: 1; color: var(--orange); }
.tbl th[data-dir="asc"], .tbl th[data-dir="desc"] { color: var(--text); }
.sortbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
.sortbar select.input { width: auto; height: 30px; padding: 0 8px; }
.sortbar .btn { font-weight: 800; }
.tbl tfoot td { border-top: 1px solid var(--border-strong); border-bottom: 0; background: var(--surface-2); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* ---------- trésorerie */
.plan-wrap { border-radius: 10px; }
table.plan td:first-child { white-space: normal; min-width: 230px; }
table.plan .pr-head td, table.plan .pr-total td { font-weight: 800; font-family: "Inter Tight"; background: var(--surface-2); }
table.plan .pr-total td { border-top: 2px solid var(--border-strong); font-size: 14.5px; }
table.plan .pr-sub-in td, table.plan .pr-sub-out td { font-weight: 700; }
table.plan .pr-sub-in td:not(:first-child) { color: var(--won); }
table.plan .pr-sub-out td:not(:first-child) { color: var(--lost); }
table.plan .pr-in td:first-child, table.plan .pr-out td:first-child { padding-left: 22px; color: var(--text-2); }
table.plan td.neg { color: var(--lost); }
table.plan td.cell-drill { cursor: pointer; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
table.plan td.cell-drill:hover { background: color-mix(in srgb, var(--orange) 10%, transparent); color: var(--text); }
table.plan tbody tr:hover { background: transparent; }
.plan-opts { display: flex; gap: 14px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.plan-opts label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.plan-opts input { accent-color: #e2332a; }
.legend { display: inline-flex; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -6px; }
.legend i.line { height: 3px; width: 16px; background: var(--grad); border-radius: 2px; }
.tr-filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tr-filters #tr-q { flex: 1; min-width: 220px; }
.tx-label { max-width: 360px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }

.stock-in { width: 90px; height: 30px; text-align: right; display: inline-block; }
.role-sel { height: 30px; font-size: 12.5px; padding: 0 6px; min-width: 170px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.check-grid label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.check-grid label:hover { border-color: var(--orange); }
.check-grid input { accent-color: #e2332a; margin-top: 2px; }

.mbar { height: 4px; border-radius: 3px; background: var(--surface-3); margin-top: 4px; min-width: 60px; overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 3px; }
a.kpi { color: inherit; display: block; }
a.kpi:hover { border-color: var(--orange); box-shadow: var(--shadow); }

/* ---------- modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 560px; box-shadow: var(--shadow); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s; }
.modal > header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: relative; }
.modal > header::after { content: ""; position: absolute; left: 20px; bottom: -1px; width: 48px; height: 2px; background: var(--grad); }
.modal .body { padding: 18px 20px; overflow: auto; }
.modal > footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: #222; color: #fff; border-radius: 10px; padding: 11px 14px; box-shadow: var(--shadow); font-weight: 600; display: flex; gap: 10px; align-items: center; border-left: 3px solid var(--orange); animation: pop .2s; max-width: 420px; }
.toast.err { border-left-color: var(--lost); }
.toast.ok { border-left-color: var(--won); }
.menu { max-height: 70vh; overflow-y: auto; max-width: calc(100vw - 20px); }
.menu { position: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; z-index: 60; min-width: 190px; }
.menu button { display: flex; width: 100%; gap: 9px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; font-weight: 600; }
.menu button:hover { background: var(--surface-3); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-stage { display: grid; grid-template-columns: 24px 1fr 110px 110px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.drag-handle { cursor: grab; color: var(--muted); display: grid; place-items: center; }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--border)); margin-bottom: 16px; font-size: 13px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }

/* ================================================================== responsive
   Téléphone ≤ 640 px (iPhone 17 : 402 px) · tablette 641–1180 px (Galaxy Tab S10 Lite portrait / paysage) · bureau */

.app, .main { height: 100vh; height: 100dvh; }
.content { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.search-toggle { display: none; }
.card .card-menu { display: none; }
.add-label { display: inline; }

/* grand écran : contenu centré, lignes de lecture confortables */
@media (min-width: 1600px) {
  .page { max-width: 1680px; margin: 0 auto; }
  .detail-grid { grid-template-columns: 440px 1fr; max-width: 1680px; margin: 0 auto; }
  .col { max-width: 380px; }
}

/* tablette et en dessous */
@media (max-width: 1180px) {
  .topbar { gap: 12px; padding: 0 16px; }
  .topbar .sep { display: none; }
  .search { max-width: 340px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .col { flex-basis: 260px; }
  .drawer { width: min(820px, 100%); }
}

@media (max-width: 1000px) {
  .detail-grid, .charts, .grid-2 { grid-template-columns: 1fr !important; }
  .detail-head::before, .focus-hero::before { display: none; }
  .toolbar .grow { display: none; }
  .ph { gap: 10px; }
}

/* écrans tactiles (téléphone, tablette) : pas de survol, cibles plus grandes */
@media (hover: none), (pointer: coarse) {
  .tl-item .tools { display: flex; }
  .card .card-menu { display: grid; }
  .card .act-ind { right: 36px; }
  .card .ttl { padding-right: 52px; }
  .btn.sm { height: 34px; }
  .btn.sm.icon { width: 34px; }
  .kpi-go { opacity: 1 !important; }
  .rail a[data-tip]:hover::after, .rail button[data-tip]:hover::after { display: none; }
}
.card-menu { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--surface-3); color: var(--text-2); place-items: center; cursor: pointer; }

/* téléphone */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 14.5px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .main { height: auto; min-height: 0; }
  /* navigation : barre du bas défilante, avec zone de sécurité iPhone */
  .rail { flex-direction: row; order: 2; justify-content: flex-start; gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid #1f1f1f;
          overflow-x: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail .mono, .rail .spacer { display: none; }
  .rail [data-hide-mobile] { display: grid; }
  .rail a, .rail button { flex: 0 0 48px; height: 44px; }
  .rail a.active::before { left: 12px; right: 12px; top: auto; bottom: -6px; width: auto; height: 3px; }
  /* en-tête compact ; la recherche s'ouvre en plein largeur */
  .topbar { height: 54px; padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); gap: 8px; }
  .topbar .logo, .search kbd { display: none; }
  .topbar .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
  .search { display: none; position: absolute; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); max-width: none; z-index: 40; }
  .search input { height: 40px; }
  .topbar.searching .search { display: block; }
  .topbar.searching .title, .topbar.searching .tax-switch, .topbar.searching #quick-add, .topbar.searching .search-toggle { visibility: hidden; }
  .search-toggle { display: grid; }
  .add-label { display: none; }
  #quick-add { width: 38px; padding: 0; }
  .tax-switch .btn { min-width: 38px; padding: 0 8px; }
  /* iOS : pas de zoom à la saisie */
  input, select, textarea, .input { font-size: 16px !important; }
  .page { padding: 14px 12px 28px; }
  .ph h1 { font-size: 20px; }
  .ph .grow { flex-basis: 100%; height: 0; }
  .ph > .btn, .ph > .btn-group, .ph > select { flex: 0 0 auto; }
  /* barres d'outils : groupes de boutons défilants plutôt que coupés */
  .toolbar { padding: 10px 12px; gap: 8px; }
  .toolbar .btn-group, .ph .btn-group, .tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .toolbar .btn-group::-webkit-scrollbar, .ph .btn-group::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: none; }
  #board-q { flex: 1; width: auto !important; }
  /* kanban : une colonne par écran, défilement aimanté */
  .board { scroll-snap-type: x mandatory; }
  .col { flex: 0 0 86vw; max-width: none; scroll-snap-align: start; }
  .dropbar { left: 0; height: 72px; padding: 10px; gap: 8px; }
  .dropbar div { font-size: 13px; }
  /* indicateurs : 2 par ligne */
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .v { font-size: 21px; }
  .kpi .s { font-size: 11.5px; }
  .kpi-go { display: none; }
  /* fiches */
  .detail-head { padding: 14px 12px; }
  .detail-head h1 { font-size: 20px; }
  .detail-head .row1 { gap: 8px; }
  .detail-head .row1 > span[style*="flex:1"] { flex-basis: 100% !important; height: 0; }
  .detail-head .facts { gap: 6px 14px; font-size: 12.5px; }
  .stagebar { overflow-x: auto; scrollbar-width: none; }
  .stagebar button { flex: 0 0 auto; min-width: 92px; }
  .detail-grid { padding: 12px; gap: 12px; }
  .kv { grid-template-columns: 105px 1fr; }
  .panel > header { flex-wrap: wrap; }
  .composer .body { padding: 12px; }
  /* tableaux : défilement horizontal, première colonne figée */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .tbl th, .tbl td { padding: 9px 10px; }
  table.plan td:first-child, table.plan th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; max-width: 170px; }
  table.plan .pr-head td:first-child, table.plan .pr-total td:first-child { background: var(--surface-2); }
  .tx-label { max-width: 160px; }
  .sortbar .sort-hint { display: none; }
  /* graphiques : lisibles, défilables */
  .chart { overflow-x: auto; }
  .chart svg { min-width: 620px; }
  .funnel-row, .funnel-row.drill { grid-template-columns: 110px 1fr 76px !important; font-size: 12.5px; }
  .legend { width: 100%; }
  .plan-opts { width: 100%; flex-wrap: wrap; }
  /* panneaux et fenêtres plein écran */
  .drawer { width: 100%; }
  .drawer-body { padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); }
  .focus-hero { padding: 16px; }
  .focus-hero .big { font-size: 34px; }
  .modal-bg { padding: 0; align-items: end; }
  .modal { max-width: 100% !important; border-radius: 16px 16px 0 0; max-height: 92dvh; }
  .modal > footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .toasts { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .settings-stage { grid-template-columns: 20px 1fr 70px 70px 34px; gap: 6px; }
  .check-grid { grid-template-columns: 1fr; }
  .tr-filters #tr-q { min-width: 100%; }
  .banner { font-size: 12.5px; }
}

/* très petits écrans */
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
}

/* ================================================================== écran de connexion */
.login-body { min-height: 100vh; min-height: 100dvh; }
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; min-height: 100dvh; }
.login-visual { position: relative; background: var(--grad-v); overflow: hidden; }
.login-visual::after { content: ""; position: absolute; inset: 0; background: url("assets/pattern_white.png") center / 420px auto; opacity: .06; }
.login-visual-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; }
.login-mono { width: 64px; height: 64px; border-radius: 16px; background: rgba(18,18,18,.35); display: grid; place-items: center; backdrop-filter: blur(6px); }
.login-mono img { width: 36px; }
.login-claim { font: 800 clamp(34px, 5vw, 64px)/1.05 "Inter Tight"; color: #fff; letter-spacing: -.02em; margin: 0; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; }
.login-logo { width: 150px; height: 26px; background: var(--logo) no-repeat left center / contain; margin-bottom: 28px; }
.login-card h1 { font-size: 26px; margin-bottom: 6px; }
.login-card form { display: grid; gap: 14px; margin-top: 22px; }
.login-card .input { height: 44px; font-size: 16px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 86px; }
.pw-wrap .btn { position: absolute; right: 6px; top: 8px; }
.pw-rules { font-size: 12.5px; margin: -4px 0 0; }
.remember { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); cursor: pointer; }
.remember input { accent-color: #e2332a; width: 16px; height: 16px; }
.login-btn { height: 46px; font-size: 15px; margin-top: 4px; }
.login-error { background: color-mix(in srgb, var(--lost) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--lost) 40%, var(--border)); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.login-foot { font-size: 12px; margin-top: 18px; }
.forgot-link { font-size: 13px; justify-self: end; margin-top: -6px; }
.back-link { display: inline-block; margin-top: 16px; font-size: 13.5px; font-weight: 700; }
.login-ok { background: color-mix(in srgb, var(--won) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--won) 40%, var(--border)); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-top: 18px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-visual-inner { padding: 22px 20px calc(22px + env(safe-area-inset-top)); flex-direction: row; align-items: center; gap: 16px; padding-top: calc(22px + env(safe-area-inset-top)); }
  .login-claim { font-size: 22px; }
  .login-claim br { display: none; }
  .login-mono { width: 48px; height: 48px; flex: none; }
  .login-panel { align-items: start; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); }
}

/* ---------- garde-fous de mise en page (tous écrans) */
.charts > *, .grid-2 > *, .detail-grid > *, .kpis > *, .board-wrap, .panel, .panel > .body { min-width: 0; }
.panel > .body:has(> table.tbl), .panel > .body:has(> .tbl) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
img, svg { max-width: 100%; }
.chart svg { max-width: none; }
@media (max-width: 640px) {
  .tr-filters #tr-q { min-width: 0; flex-basis: 100%; }
  .panel > .body > table.tbl { min-width: 560px; }
}
select.input { max-width: 100%; text-overflow: ellipsis; }
@media (max-width: 640px) { .ph > select.input { flex: 1 1 140px; min-width: 0; } }

.int-adv { margin-top: 18px; }
.int-adv summary { cursor: pointer; font: 700 11px Manrope; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
#int-panel .field .chip { height: 18px; font-size: 10.5px; padding: 0 7px; vertical-align: middle; }

/* ---------- assistant de démarrage */
.ob-page { display: grid; place-items: start center; }
.ob-card { width: 100%; max-width: 720px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; position: relative; overflow: hidden; }
.ob-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }
.ob-head h1 { font-size: 26px; margin-top: 18px; }
.ob-head p { margin: 6px 0 0; }
.ob-steps { display: flex; gap: 10px; margin: 24px 0; flex-wrap: wrap; }
.ob-step { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface-2); }
.ob-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; }
.ob-step.current { color: var(--text); }
.ob-step.current .ob-num { background: var(--grad); color: #fff; }
.ob-step.done { color: var(--won); }
.ob-step.done .ob-num { background: color-mix(in srgb, var(--won) 20%, transparent); }
.ob-body h2 { font-size: 19px; margin-bottom: 6px; }
.ob-help { color: var(--text-2); font-size: 13.5px; line-height: 1.7; padding-left: 20px; margin: 14px 0 18px; }
.ob-form { display: grid; gap: 8px; }
.ob-form label { font-weight: 700; font-size: 12.5px; color: var(--text-2); }
.ob-form .input { height: 44px; }
.ob-form .btn { height: 44px; margin-top: 6px; }
.ob-skip { margin-top: 14px; }
.ob-tasks { display: grid; gap: 10px; margin: 18px 0; }
.ob-task { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.ob-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.ob-task.running .ob-ic { background: var(--grad); color: #fff; animation: obpulse 1.2s ease-in-out infinite; }
.ob-task.ok .ob-ic { background: color-mix(in srgb, var(--won) 22%, transparent); color: var(--won); }
.ob-task.ko .ob-ic { background: color-mix(in srgb, var(--lost) 22%, transparent); color: var(--lost); }
.ob-task [data-detail] { font-size: 12.5px; }
.ob-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@keyframes obpulse { 50% { opacity: .55; } }
@media (max-width: 640px) { .ob-card { padding: 22px 16px; border-radius: 14px; } .ob-head h1 { font-size: 22px; } }
