:root{
  --ground:#F1F3F5; --surface:#FFFFFF; --surface-2:#F7F8FA;
  --ink:#101418; --muted:#5B6672; --line:#DDE2E7;
  --accent:#0F5460; --accent-soft:#DCEBED;
  --good:#1B6E4F; --good-soft:#DCEEE4;
  --mid:#8A6410; --mid-soft:#F5EBD3;
  --hot:#9C3535; --hot-soft:#F6E0DF;
  --violet:#5B3E8E; --violet-soft:#E6DFF3;
  --shadow:0 1px 2px rgba(16,20,24,.06), 0 8px 24px -16px rgba(16,20,24,.35);
}
@media (prefers-color-scheme: dark){
  :root{
    --ground:#0D1114; --surface:#151A1F; --surface-2:#1B2127;
    --ink:#E7EBEE; --muted:#94A0AC; --line:#2A323A;
    --accent:#5FB6C2; --accent-soft:#12333A;
    --good:#68C79C; --good-soft:#13322A;
    --mid:#D9AC55; --mid-soft:#33290F;
    --hot:#E58C86; --hot-soft:#35201F;
    --violet:#B49AE0; --violet-soft:#241B36;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 28px -18px rgba(0,0,0,.9);
  }
}

*{box-sizing:border-box}
body{
  margin:0; background:var(--ground); color:var(--ink);
  font-family:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased;
}
a{color:var(--accent)}
button{font:inherit; color:inherit; cursor:pointer}
input,select,textarea{font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:9px; padding:8px 11px; outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--accent)}
.wrap{max-width:1220px; margin:0 auto; padding:26px 20px 90px; display:flex; flex-direction:column; gap:20px}
.loading{color:var(--muted)}

.eyebrow{font-family:"IBM Plex Mono",ui-monospace,monospace; font-size:11.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--accent); margin:0}
h1{font-family:"Bricolage Grotesque","IBM Plex Sans",sans-serif; font-weight:700; font-size:clamp(26px,4vw,38px); line-height:1.06; letter-spacing:-.02em; margin:4px 0 4px; text-wrap:balance}
.lede{margin:0; color:var(--muted); max-width:70ch}
.topbar{display:flex; align-items:flex-end; justify-content:space-between; gap:14px; flex-wrap:wrap}
.topbar .actions{display:flex; gap:8px}

.btn{border:1px solid var(--line); background:var(--surface); border-radius:9px; padding:8px 13px; font-weight:500; box-shadow:var(--shadow)}
.btn:hover{border-color:var(--accent)}
.btn.primary{background:var(--accent); border-color:var(--accent); color:#fff}
.btn.danger{color:var(--hot)}
.btn.small{padding:4px 9px; font-size:13px; box-shadow:none}

/* pipeline */
.pipe{display:grid; grid-template-columns:repeat(auto-fit,minmax(128px,1fr)); gap:10px}
.cell{background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:11px 14px; box-shadow:var(--shadow); text-align:left}
.cell:hover{border-color:var(--accent)}
.cell[aria-pressed="true"]{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent), var(--shadow)}
.cell b{display:block; font-family:"Bricolage Grotesque",sans-serif; font-size:24px; line-height:1.15; letter-spacing:-.02em}
.cell span{font-family:"IBM Plex Mono",monospace; font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted)}

/* toolbar */
.toolbar{display:flex; flex-wrap:wrap; gap:9px; align-items:center; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:11px 12px; box-shadow:var(--shadow)}
.toolbar input[type="search"]{flex:1; min-width:190px}
.chips{display:flex; gap:6px; flex-wrap:wrap}
.chip{border:1px solid var(--line); background:var(--surface-2); border-radius:999px; padding:4px 11px; font-size:13px}
.chip[aria-pressed="true"]{background:var(--accent-soft); border-color:var(--accent); color:var(--accent); font-weight:600}

/* picks */
details.picks{background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow)}
details.picks>summary{cursor:pointer; padding:13px 16px; font-weight:600; list-style:none; display:flex; align-items:center; gap:9px}
details.picks>summary::-webkit-details-marker{display:none}
details.picks>summary::before{content:"▸"; color:var(--accent); font-size:12px}
details.picks[open]>summary::before{content:"▾"}
.picklist{padding:0 16px 16px; display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:12px}
.pick{border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:var(--surface-2)}
.pick b{display:block; margin-bottom:2px}
.pick p{margin:4px 0 0; font-size:13.5px; color:var(--muted)}

/* list */
.list{display:flex; flex-direction:column; gap:9px}
.job{display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 14px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:13px 16px; box-shadow:var(--shadow)}
.job:hover{border-color:var(--accent)}
.job .title{font-weight:600; text-decoration:none; color:var(--ink); font-size:15.5px}
.job .title:hover{color:var(--accent)}
.job .sub{color:var(--muted); font-size:13.5px; display:flex; gap:7px; flex-wrap:wrap; align-items:center}
.job .sub .dot{opacity:.5}
.job .side{display:flex; align-items:center; gap:9px; flex-wrap:wrap; justify-content:flex-end}
.badges{display:flex; gap:5px; flex-wrap:wrap; margin-top:2px}
.badge{font-family:"IBM Plex Mono",monospace; font-size:10.5px; letter-spacing:.05em; text-transform:uppercase; border-radius:6px; padding:2px 7px; background:var(--surface-2); border:1px solid var(--line); color:var(--muted)}
.badge.zone-maroc{background:var(--mid-soft); color:var(--mid); border-color:transparent}
.badge.zone-remote{background:var(--accent-soft); color:var(--accent); border-color:transparent}
.badge.pick{background:var(--violet-soft); color:var(--violet); border-color:transparent}
.badge.cv{background:var(--hot-soft); color:var(--hot); border-color:transparent}
.badge.applicants-low{background:var(--good-soft); color:var(--good); border-color:transparent}
.srclink{font-size:13px; text-decoration:none; white-space:nowrap}
.srclink:hover{text-decoration:underline}

/* status select coloring */
select.status{border-radius:999px; padding:5px 11px; font-size:13px; font-weight:600}
select.status.st-todo{background:var(--surface-2)}
select.status.st-applied{background:var(--accent-soft); color:var(--accent); border-color:transparent}
select.status.st-interview{background:var(--mid-soft); color:var(--mid); border-color:transparent}
select.status.st-offer{background:var(--good-soft); color:var(--good); border-color:transparent}
select.status.st-rejected{background:var(--hot-soft); color:var(--hot); border-color:transparent}
select.status.st-archived{opacity:.6}

/* pagination */
.pager{display:flex; align-items:center; justify-content:center; gap:8px; padding-top:6px}
.pager .btn[disabled]{opacity:.4; cursor:default}
.pager .info{font-family:"IBM Plex Mono",monospace; font-size:12.5px; color:var(--muted)}

/* detail */
.detail{background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); padding:22px 24px; display:flex; flex-direction:column; gap:16px}
.detail .head{display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; align-items:flex-start}
.detail h2{font-family:"Bricolage Grotesque",sans-serif; font-size:24px; margin:2px 0 2px; letter-spacing:-.015em}
.meta-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:10px}
.meta{background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:9px 12px}
.meta span{display:block; font-family:"IBM Plex Mono",monospace; font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted)}
.meta b{font-weight:600; font-size:14.5px; word-break:break-word}
.panel{border:1px solid var(--line); border-radius:12px; padding:15px 16px; background:var(--surface-2); display:flex; flex-direction:column; gap:10px}
.panel h3{margin:0; font-size:13px; font-family:"IBM Plex Mono",monospace; letter-spacing:.1em; text-transform:uppercase; color:var(--muted)}
.panel .row{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.panel textarea{width:100%; min-height:74px; resize:vertical}
.cv-callout{border-left:3px solid var(--hot); background:var(--hot-soft); color:var(--hot); border-radius:8px; padding:9px 13px; font-weight:500}
.about{white-space:pre-wrap; margin:0}
.navrow{display:flex; justify-content:space-between; gap:10px}

/* login */
.login{max-width:380px; margin:14vh auto 0; background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); padding:26px; display:flex; flex-direction:column; gap:12px}
.login h1{font-size:24px; margin:0}
.login .err{color:var(--hot); font-size:13.5px; margin:0}

.saving{position:fixed; right:16px; bottom:16px; background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:6px 14px; font-size:12.5px; font-family:"IBM Plex Mono",monospace; color:var(--muted); box-shadow:var(--shadow); opacity:0; transition:opacity .2s}
.saving.show{opacity:1}
.empty{color:var(--muted); text-align:center; padding:40px 0}

dialog{border:1px solid var(--line); border-radius:14px; background:var(--surface); color:var(--ink); box-shadow:var(--shadow); padding:22px; width:min(560px,92vw)}
dialog::backdrop{background:rgba(0,0,0,.45)}
dialog form{display:flex; flex-direction:column; gap:9px}
dialog .grid2{display:grid; grid-template-columns:1fr 1fr; gap:9px}
dialog label{font-size:12.5px; color:var(--muted); display:flex; flex-direction:column; gap:3px}

@media (max-width:640px){
  .job{grid-template-columns:1fr}
  .job .side{justify-content:flex-start}
}
