/* E1 "Paper" for: Work board (+ task drawer, new-task dialog), Needs you, Live activity,
   Agents & claims, Scheduled shifts. Loaded after e1.css. Page rules are scoped to .ew. */

/* shared: filter bar, rows, tables */
.ew .grow { flex: 1; }
.ew .mut { color: var(--ink3); font-size: 12.5px; }
.ew .hotn { color: var(--amb-edge); }
.ew .wbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; padding: 0 0 14px; border-bottom: 1px solid var(--rule); }
.ew .wbar input[type=search], .ew .wbar select { border: 1px solid var(--rule2); background: var(--surface); color: var(--ink1); border-radius: 8px; padding: 6px 10px; font-size: 13px; min-width: 0; }
.ew .wbar input[type=search] { flex: 1 1 220px; max-width: 320px; }
.ew .wbar select { max-width: 150px; }
.ew .wtog { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink2); cursor: pointer; padding: 5px 4px; }
.ew .seg { border-radius: 8px; padding: 2px; background: var(--sunk); border: 0; }
.ew .seg button { border-radius: 6px; padding: 4px 11px; font-size: 12.5px; font-weight: 500; }
.ew .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink1); font-weight: 600; outline: 1px solid var(--rule2); }
.ew .chip { font-size: 11.5px; padding: 1px 7px; font-weight: 600; border: 0; }
.ew .chip.warn { background: var(--amb-bg); color: var(--amb); }
.ew .chip.bad { background: var(--red-bg); color: var(--red); }
.ew .chip.ok { background: var(--ok-bg); color: var(--ok); }
.ew .chip.info { background: var(--blu-bg); color: var(--blu); }
.ew .gap { margin-top: 20px; }
.ew .card { margin-bottom: 20px; }
.ew .esub { max-width: none; gap: 20px; margin-bottom: 0; }
.ew .esub > * { flex: 1 1 380px; }
.ew .live2 > :first-child { flex: 2 1 460px; }
.ew .live2 > :last-child { flex: 1 1 300px; }

/* flat tables */
.ew table.t { font-size: 13.5px; }
.ew table.t th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); padding: 8px 12px; background: none; border-bottom: 1px solid var(--rule); }
.ew table.t td { padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ew table.t tr:last-child td { border-bottom: 0; }
.ew table.t tbody tr:hover { background: var(--panel); }
.ew table.t .ttl { font-weight: 600; }
.ew table.t .sub { font-size: 12px; color: var(--ink3); }
.ew table.t a { color: var(--blu); text-decoration: none; }
.ew table.t td, .ew table.t th { white-space: nowrap; }
.ew table.t td:first-child { white-space: normal; min-width: 150px; }
.ew .card.flush { padding: 0; }
.ew .card.flush .card-h { padding: 14px 16px 6px; }

/* dense one-line rows (live, requests, attention, closed) */
.ew .lrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--gry-bg); font-size: 13.5px; color: var(--ink1); text-decoration: none; }
.ew .lrow:first-of-type { border-top: 0; }
.ew a.lrow:hover .lb b { text-decoration: underline; }
.ew .lt { font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ew .lb { min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.ew .lb a { color: var(--blu); text-decoration: none; }
.ew .lb a:hover { text-decoration: underline; }
.ew .lb .pj { color: var(--ink2); font-weight: 600; }
.ew .lrow.fresh { animation: none; }
.ew .more { padding: 8px 0 0; }

/* Work board */
.ew .board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; overflow: visible; padding: 0; align-items: start; }
.ew .col { background: none; border: 0; border-radius: 0; padding: 0; min-width: 0; }
.ew .col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 0 8px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.ew .col-h .n { font-size: 12.5px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.ew .col-h .n.hot { color: var(--amb-edge); }
.ew .col .empty { padding: 6px 2px; color: var(--ink3); }
.ew .wc { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; text-decoration: none; color: var(--ink1); box-shadow: none; }
.ew .wc:hover { background: var(--panel); border-color: var(--rule2); }
.ew .wc-t { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ew .wc-m { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; font-size: 12px; color: var(--ink3); }
.ew .wc-m .ref { font-variant-numeric: tabular-nums; }
.ew .wc-m .pj { color: var(--ink2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew .wc-m .who { color: var(--blu); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew .col .more-btn { width: 100%; margin-top: 2px; }

/* Needs you: ranked list */
.ew .nq { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.ew .nq-h { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 16px; border-bottom: 1px solid var(--rule); }
.ew .nq-h h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.ew .nq-h span { font-size: 12.5px; color: var(--ink3); }
.ew .nq .empty { padding: 14px 16px; }
.ew .nrow { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--gry-bg); }
.ew .nq-h + .nrow { border-top: 0; }
.ew .nrow:hover { background: var(--panel); }
.ew .nrow .rk { width: 24px; height: 24px; border-radius: 6px; background: var(--ink1); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.ew .nt { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ew .nd { font-size: 12.5px; color: var(--ink2); margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ew .nmore { font-size: 12.5px; color: var(--ink2); margin-top: 3px; }
.ew .nmore summary { cursor: pointer; color: var(--blu); }
.ew .nmore ol { margin: 4px 0 0; padding-left: 18px; }
.ew .nm { display: flex; gap: 10px; font-size: 12px; color: var(--ink3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ew .nm .old { color: var(--amb-edge); font-weight: 700; }
.ew .nm .mid { color: var(--amb); }
.ew .na { display: flex; gap: 6px; }

/* dialogs / task drawer / new task (global: dialogs live outside .ew) */
.dlg { border-radius: 12px; box-shadow: none; border-color: var(--rule2); }
.dlg-h h2 { font-size: 18px; font-weight: 700; letter-spacing: -.005em; }
.dlg-h .muted { font-size: 12.5px; }
.dlg-h .muted a { color: var(--blu); }
.dlg-b { padding: 4px 20px 16px; font-size: 14px; }
.dlg-f { background: var(--panel); border-radius: 0 0 12px 12px; }
.dlg .field input, .dlg .field select, .dlg .field textarea, .dlg-f select { border-radius: 8px; border: 1px solid var(--rule2); background: var(--surface); color: var(--ink1); padding: 7px 10px; font-size: 13.5px; }
.dlg .field label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); }
.dlg .chip { font-size: 11.5px; padding: 1px 7px; font-weight: 600; border: 0; }
.dlg .chip.warn { background: var(--amb-bg); color: var(--amb); } .dlg .chip.bad { background: var(--red-bg); color: var(--red); }
.dlg .chip.ok { background: var(--ok-bg); color: var(--ok); } .dlg .chip.info { background: var(--blu-bg); color: var(--blu); }
.dlg .kv { grid-template-columns: 110px 1fr; gap: 6px 14px; font-size: 13px; padding-top: 12px; border-top: 1px solid var(--rule); }
.dlg .kv dt { color: var(--ink3); }
.dlg .err { border-radius: 8px; background: var(--amb-bg); border: 0; border-left: 3px solid var(--amb-edge); color: var(--ink1); }
.dlg .wd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.dlg-back:has(.wdrawer) { place-items: stretch end; padding: 0; }
.dlg.wdrawer { width: min(520px, 100%); min-height: 100vh; border-radius: 0; border-width: 0 0 0 1px; display: flex; flex-direction: column; }
.dlg.wdrawer .dlg-b { flex: 1; overflow-y: auto; }
.dlg.wdrawer .dlg-f { border-radius: 0; position: sticky; bottom: 0; }

@media (max-width: 900px) {
  .ew .board { grid-template-columns: 1fr; gap: 14px; }
  .ew .col.none { display: none; }
  .ew .wbar input[type=search] { flex: 1 1 100%; max-width: none; }
  .ew .wbar select { flex: 1 1 40%; max-width: none; }
  .ew .nrow { grid-template-columns: 26px minmax(0, 1fr); }
  .ew .nrow .nm, .ew .nrow .na { grid-column: 2; }
  .ew .lrow { grid-template-columns: 40px minmax(0, 1fr); }
  .ew .lrow > .chip { grid-column: 2; justify-self: start; }
  .ew .esub > * { flex-basis: 100%; }
  .dlg.wdrawer { min-height: 100vh; }
}
