/* Kannegiesser brand: URW DIN, Dark Blue #275DA1, Cyan #55A8DD, grays. Professional and industrial:
   4px radius, subtle shadows. Font metric overrides are required so DIN text is not clipped in inputs. */
@font-face { font-family: 'URW DIN'; src: url('/static/fonts/DINLight.ttf') format('truetype'); font-weight: 300; font-style: normal; font-display: swap; ascent-override: 85%; descent-override: 20%; line-gap-override: 0%; }
@font-face { font-family: 'URW DIN'; src: url('/static/fonts/DINRegular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; ascent-override: 85%; descent-override: 20%; line-gap-override: 0%; }
@font-face { font-family: 'URW DIN'; src: url('/static/fonts/DINMedium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; ascent-override: 85%; descent-override: 20%; line-gap-override: 0%; }
@font-face { font-family: 'URW DIN'; src: url('/static/fonts/din-bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; ascent-override: 85%; descent-override: 20%; line-gap-override: 0%; }
@font-face { font-family: 'URW DIN'; src: url('/static/fonts/DIN-Black.ttf') format('truetype'); font-weight: 900; font-style: normal; font-display: swap; ascent-override: 85%; descent-override: 20%; line-gap-override: 0%; }

:root {
  --blue: #275DA1; --blue-dark: #1d4a82; --blue-tint: #e9f0f9;
  --cyan: #55A8DD; --cyan-tint: #e8f4fb;
  --green: #7FC347; --orange: #F79421; --red: #DC2626; --red-tint: #fdecec;
  --white: #fff; --bg: #F5F5F5; --gray: #CCCCCC; --gray-text: #6b6b6b; --text: #333333;
  --shadow: 0 1px 2px rgba(0,0,0,.12); --shadow-lg: 0 8px 28px rgba(0,0,0,.25);
  --radius: 4px;
}
* { box-sizing: border-box; }
/* body grows with the page (min-height, not height): the sticky header can only stay on screen while its
   container is, so a body fixed at one screen tall let the header scroll away further down long pages */
html { height: 100%; }
body { margin: 0; min-height: 100%; }
body { font-family: 'URW DIN', Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.4; }
input, select, textarea, button, [role="option"] { font-family: inherit; font-size: inherit; line-height: 1.5; }
h1, h2, h3 { margin: 0; font-weight: 700; color: var(--blue); }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
a { color: var(--cyan); text-decoration: none; cursor: pointer; } a:hover { color: var(--blue); }
.muted { color: var(--gray-text); } .small { font-size: 12px; } .bold { font-weight: 700; } .nowrap { white-space: nowrap; }
.red { color: var(--red); } .right { text-align: right; } .center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; } .gap-16 { gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- header ---------- */
/* system health banner, manager only (js/health.js) */
.health-banner { display: flex; align-items: center; gap: 12px; height: 32px; padding: 0 16px; color: #fff; font-size: 13px; position: sticky; top: 0; z-index: 51; }
.health-banner.hidden { display: none; }
.health-banner.red { background: #b3261e; } .health-banner.amber { background: #b86e00; }
.health-banner .health-first { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .95; }
.health-btn { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 3px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.health-btn:hover { background: rgba(255,255,255,.3); }
#app-header { background: var(--blue); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 52px; position: sticky; top: var(--health-h, 0px); z-index: 50; box-shadow: var(--shadow); }
#app-header .logo { height: 25px; width: auto; display: block; }
#app-header .env { font-size: 11px; background: rgba(255,255,255,.18); padding: 2px 8px; border-radius: 3px; letter-spacing: .04em; }
nav#main-nav { display: flex; gap: 0; height: 100%; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
nav#main-nav a { color: #fff; padding: 0 9px; display: flex; align-items: center; height: 100%; font-weight: 500; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; flex: none; }
nav#main-nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
nav#main-nav a.active { border-bottom-color: var(--cyan); background: rgba(255,255,255,.12); }
#user-menu { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
#user-menu .who { text-align: right; line-height: 1.1; } #user-menu .who small { opacity: .8; display: block; font-size: 11px; }
#global-search { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: var(--radius); padding: 4px 10px; width: 150px; }
#global-search::placeholder { color: rgba(255,255,255,.75); }
#global-search:focus { outline: none; background: #fff; color: var(--text); }

main#view { padding: 14px 16px 40px; }
main#view.board-mode { padding: 10px 12px 10px; height: calc(100vh - 52px - var(--health-h, 0px)); overflow: hidden; display: flex; flex-direction: column; }

/* ---------- controls ---------- */
.btn { border: 1px solid var(--blue); background: var(--blue); color: #fff; border-radius: var(--radius); padding: 5px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--blue-dark); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--blue); } .btn.secondary:hover { background: var(--blue-tint); }
.btn.accent { background: var(--cyan); border-color: var(--cyan); } .btn.accent:hover { background: #3f93c9; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); } .btn.danger:hover { background: var(--red-tint); }
.btn.small { padding: 2px 9px; font-size: 12px; } .btn.icon { padding: 2px 7px; }
input[type=text], input[type=number], input[type=date], input[type=search], input[type=email], select, textarea { border: 1px solid var(--gray); border-radius: var(--radius); padding: 4px 8px; background: #fff; color: var(--text); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan-tint); }
label.field { display: flex; flex-direction: column; gap: 2px; font-weight: 500; font-size: 12px; color: var(--text); }
label.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
textarea { width: 100%; resize: vertical; }

.panel { background: #fff; border: 1px solid var(--gray); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel > .panel-head { padding: 10px 14px; border-bottom: 1px solid #e3e3e3; display: flex; align-items: center; gap: 10px; }
.panel > .panel-body { padding: 12px 14px; }
.grid { display: grid; gap: 14px; } .grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1000px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

table.t { border-collapse: collapse; width: 100%; background: #fff; }
table.t th { background: var(--blue); color: #fff; text-align: left; padding: 6px 8px; font-weight: 500; white-space: nowrap; position: sticky; top: 0; }
table.t th.sortable { cursor: pointer; } table.t th.sortable:hover { background: var(--blue-dark); }
table.t td { padding: 5px 8px; border-bottom: 1px solid #e6e6e6; vertical-align: top; }
table.t tbody tr:nth-child(even) { background: var(--bg); } table.t tbody tr:hover { background: var(--cyan-tint); }
table.t tr.clickable { cursor: pointer; }
.table-wrap { overflow: auto; border: 1px solid var(--gray); border-radius: var(--radius); }

.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 3px; padding: 0 6px; font-size: 11px; line-height: 18px; background: var(--blue-tint); color: var(--blue); white-space: nowrap; }
.chip.cyan { background: var(--cyan-tint); color: #1d6f9c; } .chip.red { background: var(--red-tint); color: var(--red); font-weight: 700; }
.chip.orange { background: #fff2e0; color: #a85d00; } .chip.green { background: #eaf6df; color: #3c7a15; } .chip.gray { background: #ececec; color: #555; } .chip.yellow { background: #F2C600; color: #222; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; flex: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }

.tile { background: #fff; border: 1px solid var(--gray); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.tile .label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-text); font-weight: 500; }
.tile .value { font-size: 26px; font-weight: 700; color: var(--blue); line-height: 1.15; }
.tile.clickable { cursor: pointer; } .tile.clickable:hover { border-color: var(--cyan); }
.tile.alert .value { color: var(--red); }
.bar { height: 8px; background: #e4e4e4; border-radius: 4px; overflow: hidden; } .bar > span { display: block; height: 100%; background: var(--blue); }
.bar.green > span { background: var(--green); } .bar.orange > span { background: var(--orange); } .bar.red > span { background: var(--red); }

/* My Dashboard: each person's own grid of widgets (12 columns) */
/* rows are 10 px steps; the page sets each widget's start and span from its measured height */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); grid-auto-rows: 10px; column-gap: 14px; row-gap: 0; align-items: start; margin-bottom: 30px; }
.dash-w { position: relative; min-width: 0; scroll-margin-top: 66px; }   /* jumping to a widget leaves it just below the 52 px header */
.dash-grid.editing .dash-w { outline: 2px dashed var(--cyan); outline-offset: 3px; border-radius: var(--radius); }
.dash-grid.editing .dash-w .tile.clickable { cursor: default; }
/* the edit bar lies over the top of the widget, so a widget is the same height in both modes */
.dash-edit { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 3px 5px; background: var(--cyan-tint); border: 1px solid var(--cyan); border-radius: var(--radius); font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dash-edit .title { font-weight: 600; color: #1d5f86; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.dash-edit .handle { cursor: grab; font-size: 16px; line-height: 1; color: #1d6f9c; padding: 0 3px; user-select: none; touch-action: none; }
.dash-edit .size { font-size: 11px; margin-left: 4px; white-space: nowrap; }
/* resize grips: right edge, bottom edge, bottom-right corner (edit mode only) */
.dash-rz { position: absolute; z-index: 6; touch-action: none; }
.dash-rz-e { top: 0; bottom: 0; right: -9px; width: 12px; cursor: ew-resize; }
.dash-rz-s { left: 0; right: 0; bottom: -9px; height: 12px; cursor: ns-resize; }
.dash-rz-se { right: -10px; bottom: -10px; width: 18px; height: 18px; cursor: nwse-resize; z-index: 7; }
.dash-rz-e::after, .dash-rz-s::after { content: ''; position: absolute; background: var(--cyan); border-radius: 3px; opacity: .55; }
.dash-rz-e::after { top: 50%; left: 4px; width: 4px; height: 36px; margin-top: -18px; }
.dash-rz-s::after { left: 50%; top: 4px; height: 4px; width: 36px; margin-left: -18px; }
.dash-rz-se::after { content: ''; position: absolute; right: 4px; bottom: 4px; width: 9px; height: 9px; border-right: 3px solid var(--cyan); border-bottom: 3px solid var(--cyan); }
.dash-rz:hover::after, .dash-w.resizing .dash-rz::after { opacity: 1; background: var(--blue); border-color: var(--blue); }
.dash-rz-se:hover::after, .dash-w.resizing .dash-rz-se::after { background: none; }
.dash-w.resizing { outline-color: var(--blue) !important; }
.dash-size-badge { position: absolute; top: 34px; right: 10px; z-index: 8; background: var(--blue); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 3px; pointer-events: none; }
body.no-select { user-select: none; }
.dash-w.dragging { opacity: .4; }
/* where a dragged widget will land: a dashed box in free space, or a bar for a new row */
.dash-grid { position: relative; }
.dash-ghost { position: absolute; z-index: 9; pointer-events: none; border-radius: var(--radius); }
.dash-ghost.cell { border: 2px dashed var(--blue); background: rgba(39, 93, 161, .08); }
.dash-ghost.newrow { background: var(--blue); }
.dash-project { max-width: 320px; font-size: 13px; }
.dash-project.active { border-color: var(--blue); background: var(--blue-tint); font-weight: 600; }
/* dashboard widget: month calendar of my due dates */
.dcal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 2px; background: #c9d0da; border: 2px solid #c9d0da; border-radius: var(--radius); }
.dcal .dow { background: var(--blue); color: #fff; text-align: center; font-size: 11px; font-weight: 700; padding: 3px 0; } .dcal .dow.weekend { background: #4a5a70; }
.dcal .d { background: #fff; min-height: 68px; padding: 2px 4px; min-width: 0; overflow: hidden; }
.dcal .d.weekend { background: #eef1f5; } .dcal .d.other { background: #f7f7f7; } .dcal .d.other .n { color: #b3b3b3; }
.dcal .d.today { background: var(--cyan-tint); box-shadow: inset 0 0 0 2px var(--cyan); }
.dcal .d .n { font-size: 11px; font-weight: 700; color: #445066; }
.dcal .more { display: block; font-size: 11px; color: var(--blue); font-weight: 600; cursor: pointer; margin-top: 1px; }
.dcal-pill { display: block; font-size: 11px; line-height: 16px; border-radius: 3px; padding: 0 5px; margin-top: 2px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.dcal-title { min-width: 120px; text-align: center; }
.dcal .d a.n { display: inline-block; cursor: pointer; } .dcal .d a.n:hover { color: var(--blue); text-decoration: underline; }
.dcal.week .d { min-height: 170px; padding: 4px; }
.dcal-views { display: inline-flex; gap: 2px; }
.dcal-day { border: 2px solid #c9d0da; border-radius: var(--radius); background: #fff; }
.dcal-day.today { border-color: var(--cyan); }
.dcal-day.empty { padding: 30px; text-align: center; color: var(--gray-text); }
.dcal-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #ececec; cursor: pointer; }
.dcal-row:last-child { border-bottom: 0; } .dcal-row:hover { background: var(--blue-tint); }
.dcal-swatch { width: 6px; align-self: stretch; border-radius: 3px; flex: none; }
/* dashboard widget: recent activity on my cards */
.act-list { display: flex; flex-direction: column; }
.act { padding: 8px 14px; border-bottom: 1px solid #ececec; cursor: pointer; border-left: 3px solid transparent; }
.act:hover { background: var(--blue-tint); }
.act-line { display: flex; gap: 8px; align-items: baseline; }
.act-card { color: var(--blue); font-weight: 500; }
.act-rating { color: #e0a100; letter-spacing: 1px; white-space: nowrap; }
.act-text { margin-top: 3px; font-size: 12px; color: #444; white-space: pre-wrap; border-left: 2px solid #ddd; padding-left: 8px; }
.act-comment { border-left-color: var(--blue); } .act-reaction { border-left-color: #e0a100; } .act-review, .act-review_request { border-left-color: var(--cyan); }
.act-assigned { border-left-color: var(--green); } .act-changed, .act-moved, .act-issue, .act-unissue { border-left-color: #b9b9b9; }
@media (max-width: 900px) { .dash-grid { grid-auto-rows: auto; row-gap: 14px; } .dash-w { grid-column: 1 / -1 !important; grid-row: auto !important; } }

/* ---------- toolbar + week box ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.weekbox { margin-left: auto; background: #fff; border: 1px solid var(--gray); border-left: 4px solid var(--blue); border-radius: var(--radius); padding: 4px 12px; min-width: 230px; box-shadow: var(--shadow); }
.weekbox .l1 { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; } .weekbox .l1 b { color: var(--blue); font-size: 15px; }
.weekbox .l2 { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-text); }
.seg { display: inline-flex; border: 1px solid var(--blue); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: #fff; color: var(--blue); padding: 4px 12px; cursor: pointer; } .seg button.on { background: var(--blue); color: #fff; }

.bell { position: relative; background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: var(--radius); height: 30px; width: 34px; cursor: pointer; font-size: 15px; }
.bell:hover { background: rgba(255,255,255,.15); }
.bell span { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 4px; }
.notice { border: 1px solid var(--gray); border-left: 4px solid var(--cyan); border-radius: var(--radius); padding: 8px 10px; background: #fff; } .notice.unread { background: var(--cyan-tint, #eaf5fc); border-left-color: var(--blue); }
.notice pre { white-space: pre-wrap; font-family: inherit; margin: 6px 0 0; font-size: 13px; }
.checklist { border: 1px solid var(--gray); border-radius: var(--radius); padding: 8px; background: #fff; }
.checklist .cl-title { flex: 1; font-weight: 700; color: var(--blue); border: 1px solid transparent; padding: 2px 4px; font: inherit; font-weight: 700; } .checklist .cl-title:hover, .checklist .cl-title:focus { border-color: var(--gray); }
.checklist .bar { margin: 6px 0; }
.cl-head, .cl-item { display: grid; grid-template-columns: 22px minmax(0,1fr) 130px 130px 22px; gap: 6px; align-items: center; margin-top: 4px; }
.cl-item .cl-text { width: 100%; border: 1px solid transparent; padding: 2px 4px; } .cl-item .cl-text:hover, .cl-item .cl-text:focus { border-color: var(--gray); }
.cl-item .cl-link { cursor: pointer; color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 4px; }
.cl-item .cl-text.done { text-decoration: line-through; color: var(--gray-text); }
.cl-item select, .cl-item input[type=date] { width: 100%; font-size: 12px; }
.checklist > input[type=text] { width: 100%; margin-top: 6px; }
.system-block { border: 1px solid var(--gray); border-radius: var(--radius); padding: 6px 8px; margin: 6px 0; background: #fafbfd; }
.app-version { color: rgba(255,255,255,.65); font-size: 10px; line-height: 1.15; max-width: 62px; margin: 0 2px; flex: none; }
/* ---------- board ---------- */
.board { display: flex; gap: 0; align-items: flex-start; overflow-x: auto; overflow-y: hidden; flex: 1; padding-bottom: 8px; position: relative; }
.board .gap { flex: none; width: 10px; align-self: stretch; position: relative; }
.board.can-edit .gap { width: 14px; }
.board.can-edit .gap:hover { background: rgba(85,168,221,.22); border-radius: 4px; }
.board.can-edit .gap:hover::after { content: '+'; position: absolute; top: 40px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; line-height: 17px; text-align: center; border-radius: 50%; background: var(--cyan); color: #fff; font-weight: 700; font-size: 14px; pointer-events: none; }
.board .divider { flex: none; width: 12px; align-self: stretch; margin: 0 4px; background: var(--blue); border-radius: 3px; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.board .divider span { writing-mode: vertical-rl; color: #fff; font-size: 10px; letter-spacing: .12em; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.board .divider.start span { transform: rotate(180deg); }
.board .drop-line { position: absolute; top: 0; bottom: 8px; width: 4px; margin-left: -2px; background: var(--cyan); border-radius: 2px; pointer-events: none; z-index: 20; box-shadow: 0 0 0 2px rgba(85,168,221,.35); }
.column.col-dragging { opacity: .45; }
.column .grip { height: 14px; flex: none; border-radius: var(--radius) var(--radius) 0 0; background: var(--grip, #c5ccd6); display: flex; align-items: center; justify-content: center; cursor: grab; user-select: none; }
.column .grip::before { content: ''; width: 44px; height: 4px; background: radial-gradient(circle, rgba(255,255,255,.9) 1.3px, transparent 1.7px) 0 0 / 7px 4px repeat-x; }
.column .grip:active { cursor: grabbing; }
.column .grip.locked { cursor: default; } .column .grip.locked::before { width: auto; height: auto; background: none; content: 'FIXED'; color: rgba(255,255,255,.9); font-size: 8px; font-weight: 700; letter-spacing: .15em; }
.column-head .name .title { cursor: text; } .column-head .name .title-edit { width: 100%; font: inherit; font-weight: 700; color: var(--blue); padding: 1px 4px; border: 1px solid var(--cyan); border-radius: 3px; }
.col-menu { border: 1px solid transparent; background: transparent; color: var(--gray-text); border-radius: 3px; cursor: pointer; width: 22px; height: 24px; flex: none; font-weight: 700; } .col-menu:hover { background: rgba(0,0,0,.08); }
.pop { position: fixed; z-index: 200; background: #fff; border: 1px solid var(--gray); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.25); padding: 8px; width: 196px; }
.pop h4 { margin: 0 0 6px; font-size: 11px; color: var(--gray-text); text-transform: uppercase; letter-spacing: .05em; }
.pop .swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
.pop .swatch { height: 26px; border-radius: 4px; border: 2px solid transparent; cursor: pointer; padding: 0; } .pop .swatch.on { border-color: var(--blue); } .pop .swatch:hover { border-color: #555; }
.pop .item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 4px; cursor: pointer; border-radius: 3px; font: inherit; } .pop .item:hover { background: #eef3fa; } .pop .item.danger { color: var(--red); }
.column { background: #e9ebee; border-radius: var(--radius); width: 292px; flex: none; max-height: 100%; display: flex; flex-direction: column; }
.column.pipeline { background: #e6edf6; } .column.issued { background: #e7f3dc; } .column.history { background: #ececec; } .column.completed { background: #e3e8ee; }
.column-head { padding: 8px 8px 6px 10px; display: flex; align-items: flex-start; gap: 6px; }
.column-head .name { flex: 1; font-weight: 700; color: var(--blue); font-size: 13px; line-height: 1.25; word-break: break-word; }
.column-head .count { font-weight: 400; color: var(--gray-text); font-size: 12px; margin-left: 4px; }
.column-head .sub { font-size: 11px; font-weight: 400; color: var(--gray-text); }
.sigma { border: 1px solid transparent; background: transparent; color: var(--blue); border-radius: 3px; cursor: pointer; font-weight: 700; width: 24px; height: 24px; flex: none; } .sigma:hover, .sigma.on { background: var(--blue); color: #fff; }
.col-totals { margin: 0 8px 6px; background: #fff; border: 1px solid var(--gray); border-radius: var(--radius); padding: 6px 8px; font-size: 12px; }
.col-systems .sys { display: block; } .col-systems .sys + .sys { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--gray); } .col-systems .sys > b { display: block; color: var(--blue); }
.col-totals div { display: flex; justify-content: space-between; gap: 8px; } .col-totals b { color: var(--blue); }
.col-extra { margin: 0 8px 6px; font-size: 12px; } .col-extra summary { cursor: pointer; color: var(--blue); font-weight: 500; } .col-extra ul { margin: 4px 0 0; padding-left: 16px; max-height: 150px; overflow: auto; background: #fff; border: 1px solid var(--gray); border-radius: var(--radius); padding: 4px 4px 4px 18px; }
.col-extra li { margin: 2px 0; }
.cards { padding: 0 8px 8px; overflow-y: auto; min-height: 34px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cards.drag-over { background: rgba(85,168,221,.18); border-radius: var(--radius); }
.add-card { margin: 0 8px 8px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 7px 9px; cursor: pointer; border-left: 4px solid transparent; font-size: 13px; }
.card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.22); }
.card.dragging { opacity: .45; }
.card.overdue { border-left-color: var(--red); } .card.hold { border-left-color: #E0B000; background: #FFF3B0; } .card.review { border-left-color: var(--cyan); } .card.returned { border-left-color: var(--orange); }
.card.project-card { border-left-color: var(--blue); }
.card .title { font-weight: 500; word-break: break-word; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 5px; margin-top: 5px; align-items: center; font-size: 11px; color: var(--gray-text); }
.card .sched { margin-top: 4px; font-size: 11px; color: var(--gray-text); }
.nohist { color: var(--red); font-weight: 700; }
.label-dots { display: flex; gap: 3px; margin-bottom: 3px; } .label-dots span { height: 6px; width: 28px; border-radius: 3px; }
.load-more { margin: 0 8px 8px; }

/* ---------- team calendar: weeks that scroll, N weeks fill the window ---------- */
.cal-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 2px solid #5f6d80; border-radius: var(--radius); background: #5f6d80; overflow: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 2px; background: #5f6d80; flex: none; }
.cal-dow div { background: var(--blue); color: #fff; text-align: center; padding: 5px; font-weight: 700; letter-spacing: .03em; } .cal-dow div.weekend { background: #4a5a70; }
.cal-scroll { flex: 1; min-height: 0; overflow-y: scroll; scroll-snap-type: y mandatory; background: #5f6d80; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 2px; height: calc(var(--rowh, 120px) - 2px); margin-bottom: 2px; scroll-snap-align: start; }
.cal-week .day { background: #fff; padding: 3px 5px; overflow: hidden; min-width: 0; }
.cal-week .day.weekend { background: #c9d0da; }
.cal-week .day.month-start { box-shadow: inset 4px 0 0 var(--blue); }
.cal-week .day.today { background: var(--cyan-tint); box-shadow: inset 0 0 0 3px var(--cyan); }
.cal-week .day .n { font-size: 12px; font-weight: 700; color: #445066; display: flex; justify-content: space-between; align-items: center; } .cal-week .day .n .mo { color: var(--blue); font-size: 13px; } .cal-week .day.today .n { color: var(--blue); }
.cal-week .pill { display: block; font-size: 11px; line-height: 16px; border-radius: 3px; padding: 0 5px; margin-top: 2px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-week .more { font-size: 11px; color: var(--blue); cursor: pointer; margin-top: 2px; font-weight: 600; }
.cal-range { min-width: 170px; text-align: center; }

/* ---------- timeline ---------- */
.tl-wrap { flex: 1; overflow: auto; scrollbar-gutter: stable; background: #fff; border: 1px solid var(--gray); border-radius: var(--radius); position: relative; }
.tl-head { position: sticky; top: 0; z-index: 5; background: #fff; }
.tl-months, .tl-days { display: flex; }
.tl-corner { position: sticky; left: 0; z-index: 6; background: var(--blue); color: #fff; width: 190px; flex: none; padding: 5px 8px; font-weight: 500; }
.tl-week { background: var(--blue); color: #fff; font-size: 11px; padding: 3px 6px; border-left: 1px solid rgba(255,255,255,.3); flex: none; white-space: nowrap; }
.tl-day { flex: none; text-align: center; font-size: 10px; color: #444; border-left: 2px solid #b9c1cc; border-bottom: 2px solid #9aa5b4; padding: 2px 0; background: #fff; box-sizing: border-box; }
.tl-day.monday { border-left: 3px solid #6f7f95; }
.tl-day.weekend { background: #f0f0f0; } .tl-day.today { background: var(--cyan); color: #fff; font-weight: 700; } .tl-day.holiday { background: #fbe9d0; }
.tl-group { border-bottom: 2px solid #b9c1cc; display: flex; }
.tl-right { display: flex; flex-direction: column; } .tl-right .tl-lanes { flex: 1; }
.tl-label { position: sticky; left: 0; z-index: 3; background: #fafafa; border-right: 1px solid var(--gray); width: 190px; flex: none; padding: 6px 8px; font-weight: 500; }
.tl-label small { display: block; font-weight: 400; color: var(--gray-text); }
.tl-lanes { position: relative; flex: none; }
.tl-bg { position: absolute; inset: 0; pointer-events: none; } .tl-bg .tl-today { position: absolute; top: 0; bottom: 0; background: rgba(85,168,221,.16); border-left: 2px solid var(--cyan); box-sizing: border-box; }
.tl-bar { position: absolute; height: 24px; border-radius: 3px; background: var(--blue); color: #fff; font-size: 11px; line-height: 24px; padding: 0 5px; overflow: hidden; white-space: nowrap; cursor: pointer; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.15); }
.tl-bar:hover { filter: brightness(1.15); z-index: 4; }
.tl-bar.overdue { background: var(--red); } .tl-bar.hold { background: #8d8d8d; } .tl-bar.review { background: var(--cyan); color: #fff; } .tl-bar.returned { background: var(--orange); } .tl-bar.done { background: #8fb76a; } .tl-bar.misc { background: #7a8aa0; }
.tl-bar .ls { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: rgba(255,255,255,.7); }
.tl-unsched { padding: 4px 6px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: #fcfcfc; }
.legend { display: flex; gap: 12px; font-size: 11px; flex-wrap: wrap; align-items: center; } .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 4px; vertical-align: -2px; }

/* ---------- calendar ---------- */

/* ---------- modal / toast ---------- */
#modal-root .backdrop { position: fixed; inset: 0; background: rgba(20,30,45,.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 36px 12px; }
.modal { background: #fff; border-radius: 6px; box-shadow: var(--shadow-lg); width: min(980px, 100%); }
.modal.narrow { width: min(520px, 100%); }
.modal-head { background: var(--blue); color: #fff; border-radius: 6px 6px 0 0; padding: 10px 16px; display: flex; gap: 10px; align-items: flex-start; }
.modal-head h2 { color: #fff; flex: 1; font-size: 17px; } .modal-head input.title-input { flex: 1; font-size: 17px; font-weight: 700; color: var(--blue); }
.modal-head .x { background: transparent; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.modal-body { padding: 14px 16px 18px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 820px) { .modal-body { grid-template-columns: 1fr; } }
.modal-foot { padding: 10px 16px; border-top: 1px solid #e3e3e3; display: flex; gap: 8px; justify-content: flex-end; }
.section { margin-bottom: 14px; } .section > h3 { margin-bottom: 6px; border-bottom: 1px solid #e3e3e3; padding-bottom: 3px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 3px 10px; font-size: 13px; } .kv dt { color: var(--gray-text); } .kv dd { margin: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 10px; }
.thumb { max-height: 120px; max-width: 100%; border: 1px solid var(--gray); border-radius: 3px; cursor: zoom-in; }
.comment { background: var(--bg); border-radius: var(--radius); padding: 6px 8px; margin-bottom: 6px; } .comment .who { font-size: 11px; color: var(--gray-text); }
/* reactions under a comment */
.reactions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.reaction { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #d5dbe3; background: #fff; border-radius: 12px; padding: 0 7px; font-size: 13px; line-height: 20px; cursor: pointer; }
.reaction:hover { border-color: var(--cyan); background: var(--cyan-tint); } .reaction:disabled { cursor: default; }
.reaction.mine { border-color: var(--blue); background: var(--blue-tint); }
.reaction .n { font-size: 11px; font-weight: 600; color: #445066; }
.reaction.add { color: var(--gray-text); font-size: 12px; padding: 0 6px; }
.reaction-picker { display: inline-flex; gap: 2px; } .reaction-picker[hidden] { display: none; }
#toasts { position: fixed; right: 14px; bottom: 14px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 9px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 380px; } .toast.error { background: var(--red); } .toast.good { background: #3c7a15; }

.dropzone { border: 2px dashed var(--cyan); background: var(--cyan-tint); border-radius: 6px; padding: 38px 16px; text-align: center; }
.dropzone.over { background: #d3ebf8; border-color: var(--blue); }
.login-box { max-width: 420px; margin: 70px auto; }
.banner { background: #fff7e6; border: 1px solid #f3c46b; border-radius: var(--radius); padding: 8px 12px; color: #7a4d00; }
.banner.red { background: var(--red-tint); border-color: #f0a0a0; color: #8f1515; } .banner.blue { background: var(--cyan-tint); border-color: #a9d3ec; color: #1d5f86; }
.empty { padding: 30px; text-align: center; color: var(--gray-text); }
.skillbar { display: inline-flex; gap: 2px; vertical-align: middle; } .skillbar i { width: 9px; height: 9px; border-radius: 2px; background: #ddd; } .skillbar i.on { background: var(--blue); }
details.type > summary { cursor: pointer; font-weight: 700; color: var(--blue); padding: 6px 0; }
.heat { display: grid; gap: 2px; } .heat .cell { padding: 3px 6px; text-align: center; font-size: 12px; border-radius: 3px; }

/* ---------- print (reports, dashboards) ---------- */
@media print {
  body { background: #fff; font-size: 11px; }
  #app-header, #toasts, .toolbar, .btn, .no-print, details > summary { display: none !important; }
  main#view, main#view.board-mode { padding: 0; height: auto; overflow: visible; display: block; }
  .panel, .tile { box-shadow: none; break-inside: avoid; }
  .table-wrap { max-height: none !important; overflow: visible !important; border: 0; }
  table.t th { background: var(--blue) !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; position: static; }
  a { color: inherit; }
}

/* several people on a card, labels as name tags, multi-select drop-downs, progress colours */
.avatars { display: inline-flex; } .avatars .avatar + .avatar { margin-left: -5px; box-shadow: 0 0 0 2px #fff; }
.label-pills { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }
.label-pills span { color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 6px; border-radius: 3px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.modal-head .label-pills { margin: 4px 0 0; } .modal-head .label-pills span { font-size: 11px; line-height: 20px; padding: 0 8px; }
details.multipick { position: relative; }
details.multipick > summary { list-style: none; cursor: pointer; border: 1px solid #c8c8c8; border-radius: 4px; padding: 4px 24px 4px 8px; background: #fff; min-height: 30px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; position: relative; }
details.multipick > summary::-webkit-details-marker { display: none; }
details.multipick > summary::after { content: '▾'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #777; }
details.multipick.disabled > summary { background: #f4f4f4; cursor: default; }
.multipick-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 2px); background: #fff; border: 1px solid #c8c8c8; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.15); max-height: 280px; overflow: auto; padding: 4px 0; min-width: 220px; }
.multipick-list label.check { display: flex; align-items: center; gap: 6px; padding: 4px 10px; margin: 0; }
.multipick-list label.check:hover { background: var(--blue-tint); }
.multipick-list .swatch { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.person-pick { display: inline-flex; align-items: center; gap: 4px; }
select.progress-pick { font-weight: 700; }
.chip.progress { color: #fff; font-weight: 700; }
.suggest { border: 1px solid #e1e1e1; border-radius: 6px; padding: 8px; margin-top: 8px; background: #fafcff; }
.suggest-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid #eee; }
.suggest-row:first-of-type { border-top: 0; }
.suggest-row .grow { min-width: 0; }
.cl-head.no-who, .cl-item.no-who { grid-template-columns: 22px minmax(0,1fr) 130px 22px; }

/* timeline task cards: a card with a grip at each end */
.tl-bar { height: 28px; line-height: 28px; border-radius: 6px; padding: 0 12px; display: flex; align-items: center; gap: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.25); border: 1px solid rgba(0,0,0,.2); user-select: none; }
.tl-bar .tl-bar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tl-bar .avatars .avatar, .tl-bar > .avatar { width: 18px; height: 18px; font-size: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.8); }
.tl-bar .grip { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; background: rgba(255,255,255,.35); }
.tl-bar .grip::after { content: ''; position: absolute; top: 7px; bottom: 7px; left: 2px; width: 3px; border-left: 1px solid rgba(255,255,255,.9); border-right: 1px solid rgba(255,255,255,.9); }
.tl-bar .grip.start { left: 0; border-radius: 6px 0 0 6px; } .tl-bar .grip.end { right: 0; border-radius: 0 6px 6px 0; }
.tl-bar .grip:hover { background: rgba(255,255,255,.6); }
.tl-bar.dragging { z-index: 6; opacity: .85; cursor: grabbing; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.tl-drop { position: absolute; top: 0; bottom: 0; background: rgba(39,93,161,.18); border: 2px dashed var(--blue); box-sizing: border-box; pointer-events: none; z-index: 2; }
details.tl-tasks { margin-top: 4px; font-weight: 400; }
details.tl-tasks > summary { cursor: pointer; font-size: 11px; color: var(--blue); }
.tl-task-list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; max-height: 260px; overflow: auto; }
.tl-task { background: #fff; border: 1px solid #d6dbe2; border-left: 3px solid var(--blue); border-radius: 4px; padding: 3px 5px; cursor: grab; font-size: 11px; }
.tl-task:hover { background: var(--blue-tint); }
.tl-task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-bar.tall { height: 42px; line-height: 15px; }
.tl-bar.tall .tl-bar-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.modal-head > .grow { min-width: 0; } .modal-head > .grow .title-input { width: 100%; }
.guide-link { color: #fff; font-size: 12px; text-decoration: underline; white-space: nowrap; margin-right: 6px; opacity: .9; } .guide-link:hover { opacity: 1; }

/* folding a board column to a narrow strip */
.fold-btn { border: 1px solid transparent; background: transparent; color: var(--gray-text); border-radius: 3px; cursor: pointer; width: 22px; height: 24px; flex: none; font-weight: 700; font-size: 15px; line-height: 1; } .fold-btn:hover { background: rgba(0,0,0,.08); color: var(--blue); }
.column.folded { width: 40px; min-height: 220px; align-items: center; gap: 6px; padding: 6px 0 10px; cursor: pointer; border-top: 4px solid var(--grip, #c5ccd6); }
.column.folded:hover { filter: brightness(.96); }
.column.folded .count { font-size: 12px; color: var(--gray-text); }
.column.folded .folded-name { writing-mode: vertical-rl; font-weight: 700; color: var(--blue); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 60vh; }

/* the ticker: the previous eight weeks (oldest on the left) and the ECR counts to the left of this week */
.weekbox { display: flex; gap: 14px; align-items: stretch; }
.weekbox .wk-now { min-width: 210px; }
.weekbox .wk-prev, .weekbox .wk-ecr { border-right: 1px solid var(--gray); padding-right: 14px; display: flex; flex-direction: column; justify-content: space-between; }
.weekbox .wk-prev { min-width: 520px; } .weekbox .wk-ecr { min-width: 150px; justify-content: center; gap: 4px; }
.weekbox .wk-prev .l2 b, .weekbox .wk-ecr .l2 b { color: var(--blue); margin-left: 10px; }
.weekbox .wk-cols { display: grid; gap: 6px; }
.weekbox .wk { display: flex; flex-direction: column; font-size: 11px; color: var(--gray-text); border-top: 5px solid var(--gray); border-radius: 2px; padding-top: 2px; white-space: nowrap; }
.weekbox .wk b { color: var(--blue); font-size: 12px; }
.weekbox .wk.green { border-top-color: #4caf50; } .weekbox .wk.yellow { border-top-color: #f2c200; } .weekbox .wk.red { border-top-color: #d9534f; }
/* narrower screens: the four oldest weeks go first, then the history, then the ECRs */
@media (max-width: 1650px) { .weekbox .wk-prev { min-width: 270px; } .weekbox .wk:nth-child(-n+4) { display: none; } .weekbox .wk-cols { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 1250px) { .weekbox .wk-prev { display: none; } }
@media (max-width: 1000px) { .weekbox .wk-ecr { display: none; } }

/* header on narrower screens: tighter tabs, a shorter search box, and the version stamp only on hover of the logo */
@media (max-width: 1800px) { nav#main-nav a { padding: 0 7px; font-size: 13px; } #global-search { width: 130px; } }
@media (max-width: 1500px) { nav#main-nav a { padding: 0 6px; font-size: 12.5px; } .app-version { display: none; } #global-search { width: 120px; } #user-menu .who small { display: none; } }
/* still too narrow for one row: the tabs wrap to two compact rows inside the same 52 px bar instead of scrolling */
@media (max-width: 1600px) { nav#main-nav { flex-wrap: wrap; align-content: center; overflow: visible; } nav#main-nav a { height: 24px; border-bottom-width: 2px; border-radius: 3px; } }

/* ECR page */
.ecr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ecr-tiles .stat { padding: 10px 14px; } .ecr-tiles .stat-n { font-size: 24px; font-weight: 700; color: var(--blue); }

/* Shop Issues (Teams chat) */
.issue-row { border-top: 1px solid var(--gray); padding: 10px 0 8px; }
.issue-row:first-child { border-top: 0; }
.issue-text { white-space: pre-wrap; margin: 6px 0 4px; max-width: 1100px; }
.issue-reply { border-left: 3px solid var(--gray); padding: 4px 0 4px 10px; margin: 6px 0; }
.issue-reply > div { white-space: pre-wrap; margin: 2px 0 4px; }
