/* Bismillah - static/ui/tools/apply.css — Application planner + JobFlow
   (ui/tools/application_planner.html, ui/tools/jobflow.html; tools_apply.py).
   Builds on kit.css (.xt-*) and expertini-ui.css tokens (--x-*).
   Prefixes: .xa- shared · .ap- planner · .jf- JobFlow. */

/* ── status colours (one place; rows, cards, chips and bars read --st) ── */
.xa-c-planned,.xa-c-search{--st:#64748b;--st-bg:#f1f5f9;--st-ink:#334155}
.xa-c-applied{--st:#2563eb;--st-bg:#eff6ff;--st-ink:#1d4ed8}
.xa-c-followed_up{--st:#0891b2;--st-bg:#ecfeff;--st-ink:#0e7490}
.xa-c-interviewing{--st:#7c3aed;--st-bg:#f5f3ff;--st-ink:#6d28d9}
.xa-c-offer{--st:#d97706;--st-bg:#fffbeb;--st-ink:#b45309}
.xa-c-accepted{--st:#059669;--st-bg:#ecfdf5;--st-ink:#047857}
.xa-c-rejected{--st:#dc2626;--st-bg:#fef2f2;--st-ink:#b91c1c}
.xa-c-no_response{--st:#a16207;--st-bg:#fefce8;--st-ink:#854d0e}
.xa-c-withdrawn,.xa-c-closed{--st:#94a3b8;--st-bg:#f8fafc;--st-ink:#475569}

.xa-st{display:inline-flex;align-items:center;gap:6px;padding:3px 10px 3px 8px;border-radius:99px;font-size:11.5px;font-weight:600;line-height:1.5;
  white-space:nowrap;background:var(--st-bg,#f1f5f9);color:var(--st-ink,#334155);border:1px solid rgba(15,23,42,.06)}
.xa-st::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--st,#64748b);flex:none}

.xa-date{display:inline-flex;align-items:center;gap:5px;padding:2px 9px;border-radius:8px;font-size:12px;font-weight:600;white-space:nowrap;
  background:#f1f5f9;color:var(--x-text-3)}
.xa-date .x-ico{width:13px;height:13px}
.xa-date--late{background:#fef2f2;color:#b91c1c}
.xa-date--today{background:#fff7ed;color:#c2410c}
.xa-date--soon{background:#eff6ff;color:#1d4ed8}

.xa-sel{height:44px;padding:0 34px 0 12px;border-radius:12px;border:1px solid var(--x-border);background:#fff;font:500 13.5px var(--x-f-body);
  color:var(--x-text-2);cursor:pointer;max-width:100%}
.xa-sel:focus{outline:0;border-color:var(--x-primary);box-shadow:var(--x-ring)}
.xa-tools{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:14px}
.xa-tools .x-fld{flex:1 1 220px;background:#fff}
.xt-guide ol{list-style:decimal;padding-left:22px;margin:0 0 10px}
.xt-guide ol li{margin-bottom:4px;list-style:decimal}
.ap-adv ol li{list-style:decimal}
.ap-adv ul li{list-style:disc}
.xa-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.xa-acts .x-btn .x-ico,.ap-coachbtn .x-ico{width:15px;height:15px}
.xa-filein{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.xa-quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.xa-quick .xt-chip{padding:3px 9px;font-size:11.5px}
.xa-hint{margin:0;font-size:12.5px;color:var(--x-subtext);line-height:1.5}
.xa-legend{display:flex;flex-wrap:wrap;gap:6px 10px;font-size:12px;color:var(--x-subtext)}

/* empty state with a call to action */
.xa-empty{padding:34px 20px;text-align:center;border:1.5px dashed #dbe3ee;border-radius:16px;background:rgba(255,255,255,.55)}
.xa-empty .x-itile{width:46px;height:46px;border-radius:14px;margin:0 auto 12px;display:flex;align-items:center;justify-content:center;color:#fff}
.xa-empty .x-itile .x-ico{width:22px;height:22px}
.xa-empty h3{margin:0 0 6px;font:600 16px/1.35 var(--x-f-disp)!important;color:var(--x-text)!important}
.xa-empty p{margin:0 auto 16px;max-width:460px;font-size:13.5px;line-height:1.6;color:var(--x-text-3)}
.xa-steps{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 18px;margin:0 0 18px;padding:0;list-style:none;font-size:12.5px;color:var(--x-text-3)}
.xa-steps li{display:flex;align-items:center;gap:7px}
.xa-steps b{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:rgba(37,99,235,.1);color:var(--x-primary);font-size:11px}

/* ═════════════ Application planner ═════════════ */
.ap-layout{display:grid;grid-template-columns:minmax(0,1fr) 316px;gap:18px;align-items:start}
.ap-side{position:sticky;top:calc(var(--x-topbar-h,64px) + 16px)}
.ap-side .xt-panel{padding:18px}

.ap-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px;padding:15px 16px 15px 20px;border-radius:14px;
  background:#fff;border:1px solid var(--x-border);transition:border-color .15s,box-shadow .15s}
.ap-row::before{content:'';position:absolute;left:0;top:14px;bottom:14px;width:4px;border-radius:0 4px 4px 0;background:var(--st,#cbd5e1)}
.ap-row:hover{border-color:rgba(37,99,235,.3);box-shadow:0 6px 18px rgba(37,99,235,.07)}
.ap-row__main{min-width:0}
.ap-row__t{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin-bottom:3px}
.ap-row__t h3{margin:0;font:600 15px/1.35 var(--x-f-disp)!important;color:var(--x-text)!important;overflow-wrap:anywhere}
.ap-row__m{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;font-size:13px;color:var(--x-text-3)}
.ap-row__m b{font-weight:600;color:var(--x-text-2)}
.ap-row__m span,.ap-row__m a{display:inline-flex;align-items:center;gap:5px}
.ap-row__m .x-ico{width:13px;height:13px;color:var(--x-subtext)}
.ap-row__m a{color:var(--x-primary)!important;font-weight:500;text-decoration:none}
.ap-row__m a:hover{text-decoration:underline}
.ap-row__d{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:9px;font-size:12.5px;color:var(--x-subtext)}
.ap-next{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:8px 11px;border-radius:10px;background:#f8fafc;font-size:13px;line-height:1.5;color:var(--x-text-2)}
.ap-next .x-ico{flex:none;width:15px;height:15px;margin-top:2px;color:var(--x-primary)}
.ap-next b{font-weight:600}
.ap-next--sug{background:transparent;padding:0;color:var(--x-subtext)}
.ap-next--sug .x-ico{color:var(--x-subtext)}
.ap-notes{margin:8px 0 0;font-size:12.5px;line-height:1.5;color:var(--x-subtext);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.ap-row__acts{display:flex;gap:6px;align-items:flex-start}
.ap-coachbtn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border-radius:8px;border:1px solid rgba(124,58,237,.25);
  background:rgba(124,58,237,.06);color:#6d28d9;font:600 12.5px var(--x-f-body);cursor:pointer;white-space:nowrap}
.ap-coachbtn:hover{background:rgba(124,58,237,.12)}
.ap-coachbtn.has-ai{background:linear-gradient(135deg,#7c3aed,#2563EB);color:#fff;border-color:transparent}
.xt-icbtn.is-done{color:#059669;border-color:#a7f3d0;background:#ecfdf5}

/* Up next (agenda) */
.ap-ag{display:flex;flex-direction:column;gap:14px}
.ap-ag h3{margin:0 0 6px;font:600 11px/1.2 var(--x-f-body)!important;letter-spacing:.07em;text-transform:uppercase;color:var(--x-subtext)!important}
.ap-ag h3.is-late{color:#b91c1c!important}
.ap-ag__list{display:flex;flex-direction:column;gap:6px}
.ap-ag__it{display:flex;align-items:center;gap:10px;padding:8px 8px 8px 8px;border-radius:12px;background:#fff;border:1px solid var(--x-border)}
.ap-ag__day{flex:none;width:42px;padding:4px 0;border-radius:9px;text-align:center;background:var(--st-bg,#f1f5f9);color:var(--st-ink,#334155);line-height:1.1}
.ap-ag__day b{display:block;font:700 15px/1.1 var(--x-f-disp)}
.ap-ag__day small{display:block;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.ap-ag__txt{flex:1;min-width:0;border:0;background:none;padding:0;text-align:left;cursor:pointer;font-family:var(--x-f-body)}
.ap-ag__txt b{display:block;font-size:13px;font-weight:600;color:var(--x-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ap-ag__txt span{display:block;font-size:12px;color:var(--x-subtext);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ap-ag__txt:hover b{color:var(--x-primary)}
.ap-ag__none{margin:0;font-size:13px;line-height:1.55;color:var(--x-subtext)}

/* status bars */
.xa-bars{display:flex;flex-direction:column;gap:10px}
.xa-bar__top{display:flex;justify-content:space-between;gap:8px;font-size:12.5px;margin-bottom:4px;color:var(--x-text-2)}
.xa-bar__top b{font-weight:600;color:var(--x-text)}
.xa-bar{height:7px;border-radius:99px;background:#eef2f7;overflow:hidden}
.xa-bar i{display:block;height:100%;border-radius:99px;background:var(--st,var(--x-primary));transition:width .5s}

/* coach dialog */
.ap-coach__job{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:-4px 0 14px;font-size:13.5px;color:var(--x-text-3)}
.ap-coach__job b{color:var(--x-text);font-weight:600}
.ap-adv{display:flex;flex-direction:column;gap:16px}
.ap-adv h4{margin:0 0 8px;font:600 13.5px/1.3 var(--x-f-disp)!important;color:var(--x-text)!important}
.ap-adv ol,.ap-adv ul{margin:0;padding-left:20px}
.ap-adv li{margin-bottom:7px;font-size:13.5px;line-height:1.6;color:var(--x-text-2)}
.ap-adv li .xt-link{margin-left:6px;font-size:12px;white-space:nowrap}
.ap-msg{padding:14px 16px;border-radius:12px;background:#fff;border:1px solid var(--x-border)}
.ap-msg__subj{margin:0 0 8px;font-size:13px;color:var(--x-subtext)}
.ap-msg__subj b{color:var(--x-text);font-weight:600}
.ap-msg .xt-prose p{font-size:13.5px;margin-bottom:8px}
.ap-adv__meta{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;font-size:12px;color:var(--x-subtext)}
.ap-coach details{border:1px solid var(--x-border);border-radius:12px;padding:0 14px;background:#fff}
.ap-coach summary{cursor:pointer;padding:11px 0;font-size:13.5px;font-weight:600;color:var(--x-text-2)}
.ap-coach details[open]{padding-bottom:12px}
.ap-dlg details{border:1px solid var(--x-border);border-radius:12px;padding:0 14px;background:#fff}
.ap-dlg summary{cursor:pointer;padding:11px 0;font-size:13.5px;font-weight:600;color:var(--x-text-2)}
.ap-dlg details[open]{padding-bottom:12px}
.ap-dlg__acts{justify-content:space-between!important;flex-wrap:wrap;gap:10px}

/* ═════════════ JobFlow ═════════════ */
.jf-top{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:10px 16px;margin-bottom:14px}
.jf-top .xt-tabs{margin:0;border:0;flex:none}
.jf-tabs{display:inline-flex;padding:3px;border-radius:12px;background:#eef2f7;gap:2px}
.jf-tabs button{border:0;background:none;display:inline-flex;align-items:center;gap:7px;padding:8px 16px;border-radius:9px;font:600 13px var(--x-f-body);color:var(--x-text-3);cursor:pointer}
.jf-tabs button .x-ico{width:15px;height:15px}
.jf-tabs button.is-on{background:#fff;color:var(--x-primary);box-shadow:0 1px 3px rgba(15,23,42,.12)}
.jf-toggle{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 14px;border-radius:12px;border:1px solid var(--x-border);background:#fff;
  font-size:13px;font-weight:500;color:var(--x-text-2);cursor:pointer;white-space:nowrap}
.jf-toggle input{width:16px;height:16px;margin:0;accent-color:var(--x-primary)}

.jf-jump{display:none;gap:6px;overflow-x:auto;margin:0 0 10px;padding-bottom:2px;scrollbar-width:none}
.jf-jump button{display:inline-flex;align-items:center;gap:6px;flex:none;padding:6px 11px;border-radius:99px;border:1px solid var(--x-border);background:#fff;
  font:600 12.5px var(--x-f-body);color:var(--x-text-2);cursor:pointer;white-space:nowrap}
.jf-jump button::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--st)}
.jf-jump b{font-weight:600;color:var(--x-subtext)}
.ap-layout .xt-panel__head{flex-wrap:wrap}
.jf-board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(206px,1fr);gap:12px;overflow-x:auto;padding:2px 2px 10px;scroll-snap-type:x proximity}
.jf-col{display:flex;flex-direction:column;min-height:320px;padding:10px;border-radius:16px;background:rgba(241,245,249,.85);border:1px solid var(--x-border);scroll-snap-align:start;min-width:0}
.jf-col.is-over{border-color:var(--x-primary);background:rgba(37,99,235,.06);box-shadow:var(--x-ring)}
.jf-col__h{display:flex;align-items:center;gap:8px;margin:2px 4px 10px}
.jf-col__h h2{margin:0;font:600 13.5px/1.2 var(--x-f-disp)!important;color:var(--x-text)!important}
.jf-col__h .xt-dot{background:var(--st)}
.jf-col__n{margin-left:auto;min-width:24px;padding:1px 8px;border-radius:99px;background:#fff;font-size:11.5px;font-weight:600;color:var(--x-subtext);text-align:center}
.jf-col__add{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;margin-top:8px;padding:8px;border-radius:10px;border:1px dashed #cbd5e1;
  background:transparent;color:var(--x-subtext);font:500 12.5px var(--x-f-body);cursor:pointer}
.jf-col__add:hover{border-color:var(--x-primary);color:var(--x-primary);background:#fff}
.jf-col__add .x-ico{width:14px;height:14px}
.jf-col__list{display:flex;flex-direction:column;gap:8px;flex:1}
.jf-col__list:empty{display:none}
.jf-col__empty{flex:1;padding-top:18px;margin:8px 4px;font-size:12.5px;line-height:1.5;color:var(--x-subtext);text-align:center}

.jf-card{position:relative;padding:11px 12px 10px 14px;border-radius:12px;background:#fff;border:1px solid var(--x-border);box-shadow:0 1px 2px rgba(15,23,42,.05);cursor:grab;min-width:0}
.jf-card::before{content:'';position:absolute;left:0;top:10px;bottom:10px;width:3px;border-radius:0 3px 3px 0;background:var(--st,#cbd5e1)}
.jf-card:hover{border-color:rgba(37,99,235,.35)}
.jf-card.is-drag{opacity:.45}
.jf-card__co{margin:0 0 2px;font-size:11.5px;font-weight:600;color:var(--x-subtext);letter-spacing:.01em;overflow-wrap:anywhere}
.jf-card__t{display:block;width:100%;margin:0;padding:0;border:0;background:none;text-align:left;cursor:pointer;font:600 13.5px/1.35 var(--x-f-disp);color:var(--x-text);overflow-wrap:anywhere}
.jf-card__t:hover{color:var(--x-primary)}
.jf-card__m{margin:4px 0 0;font-size:12px;line-height:1.45;color:var(--x-subtext);overflow-wrap:anywhere}
.jf-card__f{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:9px}
.jf-age{font-size:11.5px;color:var(--x-subtext);white-space:nowrap}
.jf-stale{display:inline-flex;align-items:center;gap:4px;padding:1px 7px;border-radius:7px;background:#fff7ed;color:#c2410c;font-size:11px;font-weight:600;white-space:nowrap}
.jf-card__acts{display:flex;gap:4px;margin-left:auto}
.jf-card__acts .xt-icbtn{width:26px;height:26px;border-radius:7px}
.jf-card__acts .xt-icbtn .x-ico{width:13px;height:13px}

/* outcome dialog */
.jf-outs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:4px 0 6px}
.jf-out{display:flex;flex-direction:column;align-items:center;gap:6px;padding:16px 10px;border-radius:14px;border:1px solid var(--x-border);background:#fff;cursor:pointer;
  font:600 13.5px var(--x-f-body);color:var(--x-text)}
.jf-out::before{content:'';width:12px;height:12px;border-radius:50%;background:var(--st)}
.jf-out small{font-weight:400;font-size:11.5px;color:var(--x-subtext);text-align:center;line-height:1.4}
.jf-out:hover{border-color:var(--st);box-shadow:0 0 0 3px var(--st-bg)}

/* stage history in the edit dialog */
.jf-hist{list-style:none;margin:0;padding:0 0 0 4px;display:flex;flex-direction:column;gap:0}
.jf-hist li{position:relative;display:flex;align-items:center;gap:10px;padding:5px 0 5px 18px;font-size:13px;color:var(--x-text-2)}
.jf-hist li::before{content:'';position:absolute;left:0;top:50%;width:9px;height:9px;margin-top:-4.5px;border-radius:50%;background:var(--st,#94a3b8)}
.jf-hist li::after{content:'';position:absolute;left:4px;top:50%;bottom:-50%;width:1px;background:#e2e8f0}
.jf-hist li:last-child::after{display:none}
.jf-hist time{margin-left:auto;font-size:12px;color:var(--x-subtext)}

/* analytics */
.jf-kpi{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.jf-kpi div{padding:12px 14px;border-radius:12px;background:#fff;border:1px solid var(--x-border)}
.jf-kpi b{display:block;font:600 22px/1.15 var(--x-f-disp);color:var(--x-text)}
.jf-kpi span{display:block;font-size:12px;color:var(--x-subtext);margin-top:2px}
.jf-formula{margin:12px 0 0;font-size:12px;line-height:1.55;color:var(--x-subtext)}
.jf-wait{display:flex;flex-direction:column;gap:6px}
.jf-wait button{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:9px 12px;border-radius:10px;border:1px solid var(--x-border);
  background:#fff;cursor:pointer;text-align:left;font:13px var(--x-f-body);color:var(--x-text-2)}
.jf-wait button:hover{border-color:var(--x-primary)}
.jf-wait b{font-weight:600;color:var(--x-text)}
.xt-stat small{display:block;margin-top:3px;font-size:11.5px;color:var(--x-subtext);line-height:1.35}

@media (max-width:1100px){
  .ap-layout{grid-template-columns:1fr}
  .ap-side{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
}
@media (max-width:720px){
  .ap-side{grid-template-columns:1fr}
  .ap-row{grid-template-columns:1fr;padding:14px 14px 12px 18px}
  .ap-row__acts{justify-content:flex-start;flex-wrap:wrap}
  .xa-tools .x-fld{flex-basis:100%}
  .xa-tools .xa-sel{flex:1 1 120px;width:0;min-width:0}
  .jf-jump{display:flex}
  .ap-dlg__acts .xt-row{width:100%;flex-wrap:nowrap}
  .ap-dlg__acts .xt-row .x-btn{flex:1}
  .jf-board{grid-auto-columns:minmax(80vw,1fr)}
  .jf-kpi{grid-template-columns:1fr 1fr}
  .jf-kpi div:last-child{grid-column:1/-1}
  [data-jf-src] .xt-table th,[data-jf-src] .xt-table td{padding:9px 10px}
  .jf-outs{grid-template-columns:1fr}
  .jf-top{align-items:stretch}
  .jf-top>.xa-acts{width:100%}
}
@media print{.ap-row__acts,.jf-card__acts,.jf-col__add{display:none!important}}
