/* Job Deck web: looks like the Windows (FMX) app. Colors and sizes come from
   shared/theme/jobdeck-theme.json, applied as CSS variables by js/theme.js. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--window); color: var(--text); font: 13px var(--font); overflow: hidden;
  -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
#app { display: flex; flex-direction: column; height: 100vh; }

/* ---- menu bar + search ---- */
.menubar { height: 38px; flex: none; display: flex; align-items: center; background: var(--surface);
  padding: 0 8px; position: relative; z-index: 20; }
.menubar > .menu-title { height: 30px; padding: 0 11px; border-radius: 6px; border: 0; background: transparent;
  cursor: default; font-size: 13px; }
.menubar > .menu-title:hover, .menubar > .menu-title.open { background: var(--hover); }
.menubar .spacer { flex: 1; }
.search { width: 292px; margin: 3px 16px 3px 8px; position: relative; }
.search input { width: 100%; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--raised);
  padding: 0 30px 0 10px; }
.search input:focus { outline: none; border-color: var(--accent); }
.search .clear { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border: 0; background: transparent;
  border-radius: 4px; padding: 0; cursor: pointer; }
.search .clear img { width: 16px; height: 16px; }
/* Sync state sits in the status bar where the Windows app shows its sync text (after "Autosave on"). */
.sync { font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; padding: 0 2px; white-space: pre; display: inline-flex; align-items: center; gap: 5px; }
.sync:hover .txt { text-decoration: underline; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync.ok .dot { background: #278C59; } .sync.busy .dot { background: var(--accent); }
.sync.warn .dot { background: #BD862C; } .sync.bad .dot { background: #CE5360; }

/* drop-down menus (also used for context menus) */
.dropdown { position: fixed; z-index: 100; min-width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.dropdown .item { display: flex; align-items: center; height: 28px; padding: 0 10px 0 28px; border-radius: 4px;
  position: relative; white-space: nowrap; cursor: default; gap: 24px; }
.dropdown .item:hover, .dropdown .item.active { background: var(--hover); }
.dropdown .item.disabled { color: var(--muted); pointer-events: none; }
.dropdown .item .label { flex: 1; } .dropdown .item .key { color: var(--muted); font-size: 12px; }
.dropdown .item.checked::before { content: "\2713"; position: absolute; left: 9px; }
.dropdown .item.radio.checked::before { content: "\25CF"; font-size: 9px; left: 11px; }
.dropdown .item.sub::after { content: "\203A"; position: absolute; right: 9px; color: var(--muted); }
.dropdown .sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* ---- ribbon ---- */
.ribbon { height: 78px; flex: none; background: var(--surface); border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); display: flex; padding-left: 16px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; }
.ribbon::-webkit-scrollbar { display: none; }
.rgroup { position: relative; padding: 2px 12px 0 0; margin-right: 12px; display: flex; flex-direction: column; }
.rgroup::after { content: ""; position: absolute; right: 6px; top: 8px; width: 1px; height: 56px; background: var(--border); }
.rgroup .buttons { display: flex; gap: 2px; height: 56px; }
.rgroup .caption { font-size: 10.5px; color: var(--muted); text-align: center; height: 16px; line-height: 16px; margin-top: 1px; }
.rbtn { min-width: 46px; height: 56px; border: 1px solid transparent; border-radius: 9px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; padding: 6px 5px 0; cursor: pointer; }
.rbtn img { width: 24px; height: 24px; }
.rbtn span { font-size: 10.5px; margin-top: 3px; white-space: nowrap; }
.rbtn:hover { background: var(--hover); }
.rbtn:active { background: color-mix(in srgb, var(--hover) 76%, var(--accent)); }
.rbtn.on { background: var(--selection); border-color: color-mix(in srgb, var(--border) 60%, var(--accent)); }

/* ---- banners ---- */
.banner { flex: none; height: 44px; margin: 6px 8px 0; border-radius: 6px; border: 1px solid; display: flex;
  align-items: center; gap: 4px; padding: 0 8px 0 14px; font-size: 12px; }
.banner .text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner.attention { background: var(--attention-fill); border-color: var(--attention-stroke); }
.banner.reason { background: var(--reason-fill); border-color: var(--reason-stroke); }

/* ---- buttons (Echo style) ---- */
.btn { height: 30px; min-width: 64px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--raised); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:focus-visible { outline: none; border-color: var(--accent); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-hover); }
.btn:disabled { background: var(--surface); color: var(--muted); cursor: default; }

/* ---- board ---- */
.board { flex: 1; min-height: 0; overflow: auto; position: relative; outline: none; }
.board-inner { display: flex; gap: 14px; padding: 16px; width: max-content; min-height: 100%; align-items: stretch; }
.column { width: 284px; flex: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; position: relative; }
.column.selected, .column.selected .col-head .inner { border-color: var(--accent); }
.column.drag-over, .column.drag-over .col-head .inner { background: var(--drag-hover); }
/* Headers stay pinned while the whole board scrolls (as in the Windows app since 0.1.0.8). The outer
   layer is window-colored so cards scrolling underneath never show around the rounded corners. */
.col-head { position: sticky; top: 16px; z-index: 3; height: 56px; flex: none; margin: -1px -1px 0;
  background: var(--window); box-shadow: 0 -16px 0 0 var(--window); }
.col-head .inner { position: absolute; inset: 0; background: var(--surface); border: 1px solid var(--border);
  border-bottom: 0; border-radius: 12px 12px 0 0; }
.col-head .bar { position: absolute; left: 14px; top: 12px; width: 24px; height: 4px; border-radius: 2px; }
.col-head .title { position: absolute; left: 14px; right: 64px; top: 20px; height: 24px; line-height: 24px;
  font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head .count { position: absolute; right: 14px; top: 20px; width: 56px; height: 24px; line-height: 24px;
  text-align: right; font-size: 12px; color: var(--muted); }
.col-head .line { position: absolute; left: 10px; right: 10px; bottom: 0; height: 1px; background: var(--border); }
.col-body { padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 10px; flex: 1; position: relative; }
.col-empty { text-align: center; color: var(--muted); font-size: 12px; padding-top: 4px; height: 26px; line-height: 26px; }
.drop-bar { position: absolute; left: 10px; right: 10px; height: 4px; border-radius: 2px; background: var(--accent);
  pointer-events: none; z-index: 2; }

/* ---- cards ---- */
.card { position: relative; height: 112px; flex: none; border-radius: 12px; background: var(--raised);
  border: 1px solid var(--card-border); box-shadow: 0 2px 0 0 var(--card-shadow); cursor: default; user-select: none;
  overflow: hidden; }
.card:hover { background: var(--card-hover); border-color: var(--card-hover-border); }
.card.selected { background: var(--selection); border: 2px solid var(--accent); }
.card.stale { border-color: var(--stale-border); } .card.escalated { border-color: var(--escalated-border); }
.card.selected.stale, .card.selected.escalated { border-color: var(--accent); }
.card.dragging-source { visibility: hidden; }
.card .rail { position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 2px; }
.card .t { position: absolute; left: 15px; right: 11px; top: 7px; height: 22px; line-height: 22px; font-size: 13px;
  font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .co { position: absolute; left: 15px; right: 11px; top: 29px; height: 20px; line-height: 20px; font-size: 12px;
  opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .mid { position: absolute; left: 15px; right: 11px; top: 55px; height: 22px; display: flex; gap: 8px; }
.card .pill { position: relative; flex: none; height: 22px; line-height: 22px; border-radius: 11px;
  padding: 0 8px 0 21px; font-size: 11px; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .pill i { position: absolute; left: 9px; top: 7.5px; width: 7px; height: 7px; border-radius: 50%; }
.card .applied { flex: 1; min-width: 0; text-align: right; height: 22px; line-height: 22px; font-size: 11px;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .bottom { position: absolute; left: 15px; right: 11px; top: 82px; height: 20px; display: flex; align-items: center; gap: 6px; }
.card .ev { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { flex: none; height: 20px; line-height: 20px; border-radius: 10px; padding: 0 9px; font-size: 11px; font-weight: 700;
  white-space: nowrap; }
.tag { flex: none; height: 20px; line-height: 20px; border-radius: 10px; padding: 0 9px; font-size: 10.5px; font-weight: 700;
  white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; background: var(--tag-bg); }
.badge.stale { color: var(--stale); background: var(--stale-bg); } .badge.escalated { color: var(--escalated); background: var(--escalated-bg); }

.card.compact { height: 50px; border-radius: 8px; box-shadow: 0 1.5px 0 0 var(--card-shadow); }
.card.compact .rail { top: 8px; bottom: 8px; }
.card.compact .top { position: absolute; left: 13px; right: 7px; top: 4px; height: 22px; display: flex; align-items: center; gap: 6px; }
.card.compact .t { position: static; flex: 1; min-width: 0; font-size: 12.5px; height: 22px; line-height: 22px; }
.card.compact .badge { height: 18px; line-height: 18px; font-size: 10.5px; padding: 0 7px; border-radius: 9px; }
.card.compact .line2 { position: absolute; left: 13px; right: 7px; top: 25px; height: 20px; display: flex; align-items: center; gap: 8px; }
.card.compact .co { position: static; flex: 1; min-width: 0; font-size: 11px; color: var(--muted); opacity: 1; height: 20px; line-height: 20px; }
.card.compact .abbr { flex: none; max-width: 45%; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.compact .tag { height: 16px; line-height: 16px; font-size: 10px; padding: 0 7px; border-radius: 8px; max-width: 50%; }

.drag-ghost { position: fixed; z-index: 50; pointer-events: none; opacity: .88; width: 264px; }
.drag-ghost .card { background: var(--selection); border: 2px solid var(--accent); }

/* ---- status bar ---- */
.statusbar { height: 26px; flex: none; display: flex; align-items: center; padding: 0 8px; font-size: 11px; color: var(--muted);
  background: var(--surface); border-top: 1px solid var(--border); white-space: pre; overflow: hidden; }

/* ---- dialogs (Echo dialogs) ---- */
.overlay { position: fixed; inset: 0; background: rgba(16,20,28,.35); z-index: 60; display: grid; place-items: center; }
.dialog { background: var(--window); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 16px 48px rgba(0,0,0,.28);
  display: flex; flex-direction: column; max-width: 96vw; max-height: 94vh; font-size: 12px; }
.dialog .head { padding: 20px 24px 12px; } .dialog .head h2 { margin: 0; font-size: 18px; }
.dialog .head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.dialog .body { padding: 4px 24px 8px; overflow: auto; flex: 1; min-height: 0; }
.dialog .foot { height: 64px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 24px; }
.dialog .foot .grow { flex: 1; }
.dialog .foot .btn { height: 38px; min-width: 96px; }
.field { display: block; margin-bottom: 10px; } .field > span { display: block; color: var(--text); margin-bottom: 4px; font-size: 12px; }
.field input, .field select, .field textarea, .dialog textarea { width: 100%; border: 1px solid var(--border); border-radius: 3px;
  background: var(--raised); padding: 0 8px; height: 28px; }
.field textarea, .dialog textarea { height: auto; padding: 6px 8px; resize: none; line-height: 1.45; }
.field input:focus, .field select:focus, .dialog textarea:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: flex-end; } .row > .field { flex: 1; } .row > .btn { height: 28px; margin-bottom: 10px; border-radius: 3px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--muted); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabpane { padding-top: 8px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.list { border: 1px solid var(--border); border-radius: 3px; background: var(--raised); overflow: auto; flex: 1; min-height: 0; }
.list .li { height: 30px; line-height: 30px; padding: 0 10px; white-space: pre; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.list .li:hover { background: var(--hover); } .list .li.sel { background: var(--selection); }
.list .li.auto { color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 8px; }
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 90; max-width: 70vw; }
.splash { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }

/* ---- dialog layouts ---- */
.dialog .foot .lefts { display: flex; gap: 10px; }
.jobform { display: flex; gap: 20px; height: 100%; }
.jobform .jleft { width: 330px; flex: none; }
.jobform .jleft .field { margin-bottom: 8px; }
.jobform .jright { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jobform .tabpane textarea { flex: 1; margin: 0; }
.evbar { display: flex; gap: 8px; padding: 0 0 8px; } .evbar .btn { height: 28px; border-radius: 3px; }
.dialog .body:has(.jobform), .dialog .body:has(.paste), .dialog .body:has(.colform), .dialog .body:has(.review) { overflow: hidden; }
.paste { display: flex; gap: 20px; height: 100%; }
.paste > textarea { width: 450px; flex: none; height: 100%; }
.paste .pright { flex: 1; overflow: auto; }
.check { display: flex; align-items: center; gap: 6px; height: 20px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; }
.check input { margin: 0; accent-color: var(--accent); }
.pf { width: 100%; height: 28px; border: 1px solid var(--border); border-radius: 3px; background: var(--raised); padding: 0 8px; margin-bottom: 10px; }
.pf:focus { outline: none; border-color: var(--accent); }
.summary, .rsum { color: var(--muted); font-size: 12px; margin-top: 10px; line-height: 1.4; }
.colform, .review { display: flex; gap: 16px; height: 100%; }
.colform .list { flex: 1; } .review .rleft { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side { width: 140px; flex: none; display: flex; flex-direction: column; gap: 10px; }
.review .side { width: 230px; gap: 6px; } .review .side > .btn { margin-bottom: 8px; }
.side .btn { height: 28px; border-radius: 3px; }
.side .bulk { margin-top: auto; }
.side .bulk .btn { width: 100%; }
.dropdown .item { position: relative; }
