/* drop-down filters */
.grid thead tr.filters .fdrop { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 4px; border: 1px solid var(--line); border-radius: var(--r); padding: 2px 6px; font-size: 12px; background: var(--panel); color: var(--muted); height: 22px; text-align: left; }
.grid thead tr.filters .fdrop span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid thead tr.filters .fdrop.on { border-color: var(--accent); color: var(--title); font-weight: 600; background: var(--accent-soft); }
.fdrop .car { font-size: 10px; flex: none; }
.fmenu { width: 280px; padding: 10px; }
.fmenu h4 { margin: 0 0 8px; font-size: 13px; }
.fmenu .fsearch { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.fmenu .frow { display: flex; gap: 12px; margin: 8px 2px; font-size: 12px; }
.fmenu .flist { max-height: 320px; overflow: auto; border-top: 1px solid var(--line-soft); padding-top: 4px; }
.fmenu .flist label { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 4px 4px; }
.fmenu .flist label[hidden] { display: none; }
.fmenu .flist .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmenu .flist .n { font: 11px var(--mono); color: var(--muted); }
/* mini calendar */
.dpick { position: fixed; z-index: 60; width: 236px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 4px; box-shadow: 0 8px 24px rgba(9, 34, 66, .18); padding: 8px; user-select: none; }
.dpick button { border: 0; background: none; border-radius: 4px; cursor: pointer; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.dp-head b { color: var(--title); font-size: 13px; }
.dp-head button { width: 28px; height: 26px; font-size: 16px; }
.dp-head button:hover, .dp-grid button:hover, .dp-foot button:hover { background: var(--head); }
.dp-dow, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dp-dow span { font-size: 10.5px; color: var(--muted); font-weight: 600; padding: 2px 0; }
.dp-grid button { height: 28px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dp-grid button.out { color: var(--muted); opacity: .55; }
.dp-grid button.today { box-shadow: inset 0 0 0 1.5px var(--orange); font-weight: 700; }
.dp-grid button.sel, .dp-grid button.sel:hover { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dp-grid button.sel { background: var(--accent); color: var(--accent-ink); } }
.dp-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 6px; }
.dp-foot button { padding: 4px 8px; font-size: 12px; color: var(--accent); font-weight: 600; }
/* header column menu */
.grid th .hm { position: absolute; right: 8px; top: 4px; opacity: 0; padding: 0 4px; border-radius: 3px; cursor: pointer; font-weight: 700; }
.grid thead tr:first-child th { padding-right: 20px; }
.grid th:hover .hm, .grid th .hm:focus { opacity: .85; }
.grid th .hm:hover { background: rgba(255,255,255,.18); opacity: 1; }
.grid th .lk::before { content: "🔒"; font-size: 10px; margin-right: 4px; opacity: .8; }
.hmenu { width: 230px; padding: 6px; }
.hmenu h4 { margin: 4px 8px 6px; font-size: 12px; color: var(--muted); }
.hmenu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 3px; }
.hmenu button:hover:not(:disabled) { background: var(--head); }
.hmenu button:disabled { opacity: .4; }
.sheet-btn .ct b { color: var(--warn); font-weight: 600; }
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(9, 34, 66, .45); display: grid; place-items: center; padding: 16px; }

/* Edit mode: the editor opens view-only; edit tools show only while editing */
#app:not(.edit-on) .edit-only { display: none !important; }
#app.edit-on .view-only { display: none !important; }
#editNote { background: var(--accent-soft); color: var(--title); font-size: 12px; padding: 6px 14px; border-bottom: 1px solid var(--line); }
#editNote .link { margin-left: 8px; }
.grid tr.vpad td { padding: 0; border: 0; background: transparent; }

/* grid + job details panel */
#gridArea { flex: 1; display: flex; min-height: 0; min-width: 0; }
#gridArea #gridWrap { flex: 1; min-width: 0; }
#jobPanel { width: 380px; flex: none; overflow: auto; border-left: 1px solid var(--line); background: var(--panel); padding: 14px 16px 24px; font-size: 13px; }
#jobPanel h2 { margin: 0 0 4px; font-size: 16px; color: var(--title); }
#jobPanel h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.jp-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.jp-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.jp-x:hover { color: var(--ink); }
.jp-next { display: block; text-align: center; margin: 12px 0 4px; text-decoration: none; }
.jp-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 12px 0 0; }
.jp-facts div { display: contents; }
.jp-facts dt { color: var(--muted); }
.jp-facts dd { margin: 0; overflow-wrap: anywhere; }
.jp-text { margin: 0; white-space: pre-wrap; }
.jp-flags, .jp-notes, .jp-hist { margin: 0; padding-left: 18px; }
.jp-flags li, .jp-notes li, .jp-hist li { margin: 3px 0; }
.jp-flags li.bad b { color: var(--bad, #b42318); }
.jp-hist .muted { display: block; font-size: 11.5px; }
.jp-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0; }
.jp-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }

/* finding a job on any sheet (sidebar) */
#jobHits .job-hit { display: grid; width: 100%; text-align: left; border: 0; background: none; padding: 6px 14px; cursor: pointer; font: inherit; color: inherit; gap: 1px; }
#jobHits .job-hit:hover { background: var(--sel); }
#jobHits .job-hit span { font-size: 12px; }
#jobHits .jh-msg { padding: 0 14px; margin: 4px 0 8px; font-size: 12px; }

@media (max-width: 760px) {
  #gridArea.panel-on #gridWrap { display: none; }
  #jobPanel { width: auto; flex: 1; border-left: 0; }
}
#jobPanel .muted, #jobHits .muted { color: var(--muted); }
