/* People module: dialogs, roster details, clock station, team chat, incidents. */

/* Dialog */
.dlg-back { position: fixed; inset: 0; z-index: 55; background: rgba(9,9,11,0.45); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; }
.dlg { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); }
.dlg.wide { width: min(680px, 100%); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.dlg-body { padding: 18px; }
.dlg-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.dlg .repeat { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.dlg .quote { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--text-3); } .facts dd { margin: 0; white-space: pre-wrap; }

/* Roster */
.roster th.today { color: var(--text); }
.roster th .hol { font-size: 11px; color: var(--warn); font-weight: 500; }
.roster tr.mine td { background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.roster tr.mine td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.roster tr.open-row td { background: var(--panel-2); }
.roster tr.open-row td:first-child { background: var(--panel-2); }
.shift.edit { cursor: pointer; }
.shift.edit:hover { border-color: var(--text-3); }
.shift .muted { font-weight: 400; }
.shift.draft { border-style: dashed; }
.shift.flag { box-shadow: inset 2px 0 0 var(--warn); }
.shift.open { background: var(--panel); border: 1px dashed var(--line-2); flex-wrap: wrap; }
.away { font-size: 11.5px; color: var(--text-3); background: repeating-linear-gradient(135deg, var(--panel-2), var(--panel-2) 4px, var(--panel) 4px, var(--panel) 8px);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; margin-bottom: 4px; }
.away.pending { color: var(--warn); }
.neg { color: var(--neg); } .pos { color: var(--pos); } .warn-t { color: var(--warn); }
.roster th .gap { font-size: 11px; color: var(--neg); font-weight: 500; }
.skills { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.skills span { font-size: 10.5px; color: var(--text-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.shift .pill { padding: 0 6px; font-size: 10.5px; }
.shift .btn.small { padding: 2px 8px; font-size: 11.5px; }
.shift[draggable="true"] { cursor: grab; }
.shift.dragging, .person.dragging { opacity: .45; }
.roster td.over { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); box-shadow: inset 0 0 0 1px var(--accent); }
.roster.areas .shift b { font-weight: 600; }
.team-strip { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.team-strip > .small { flex: none; margin-right: 6px; max-width: 190px; line-height: 1.3; }
.person { flex: none; }
.person { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 500; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); cursor: grab; }
.person i { font-style: normal; color: var(--text-3); font-weight: 400; }
.person:hover { border-color: var(--text-3); }

/* Roster tools menu */
.tools { position: relative; }
.tools-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 260px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); }
.tools-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--text); }
.tools-menu button span { display: block; font-size: 12px; color: var(--text-3); }
.tools-menu button:hover { background: var(--panel-2); }
.tools-menu button.danger { color: var(--neg); }
.dayseg { margin: -4px 0 12px; }
.tpl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tpl .tpl-days { display: flex; flex-wrap: wrap; gap: 4px 12px; grid-column: 1; }
.tpl > span { grid-row: 1 / span 2; grid-column: 2; }

/* Day view: each shift as a bar on the day's hours, under people on against people needed */
.dayview { padding: 6px 0 0; min-width: 760px; }
.dv-row { display: grid; grid-template-columns: 180px 1fr; align-items: center; border-bottom: 1px solid var(--line); min-height: 40px; }
.dv-label { padding: 6px 14px; font-size: 13px; line-height: 1.3; }
.dv-track { display: grid; grid-template-columns: repeat(var(--cols), 1fr); align-items: center; height: 100%; padding: 5px 10px 5px 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--cols) * 4) 100%; }
.dv-head .dv-track span { font-size: 11px; color: var(--text-3); padding-left: 4px; }
.dv-need .dv-track span { text-align: center; font-size: 12.5px; font-weight: 600; margin: 0 2px; border-radius: 5px; padding: 3px 0; background: var(--panel-2); color: var(--text-3); }
.dv-need .dv-track span i { font-style: normal; font-weight: 400; opacity: .7; }
.dv-need .dv-track span.ok { background: var(--pos-bg); color: var(--pos); }
.dv-need .dv-track span.under { background: var(--warn-bg); color: var(--warn); }
.dv-need .dv-track span.over { background: var(--panel-3); color: var(--text-2); }
.dv-bar { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 5px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.dv-bar.open { background: var(--panel); border-style: dashed; border-color: var(--line-2); }
.dv-bar.flag { box-shadow: inset 3px 0 0 var(--warn); }
.dv-bar.edit { cursor: pointer; }
.dv-bar.edit:hover { border-color: var(--text-3); }
.dv-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 14px; }

@media print {
  .roster .addshift, .roster .btn, .tools, #rview, #publish, .seg, .team-strip, .kpis, .dlg-back { display: none !important; }
  .roster td, .roster th { font-size: 10.5px; padding: 4px; }
  .shift { box-shadow: none; border: 1px solid #999; }
  .card.flush, .table-wrap { overflow: visible !important; }
}

/* Clock station */
.clock-now { text-align: right; line-height: 1.2; }
.clock-now b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clock-now span { font-size: 12.5px; color: var(--text-3); }
.station { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.station-tile { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; gap: 4px 12px; align-items: center; text-align: left; padding: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; transition: border-color .12s, background .12s; }
.station-tile:hover { border-color: var(--text-3); }
.station-tile .av { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.station-tile.on .av { background: var(--accent); color: var(--accent-text); }
.station-tile.break .av { background: var(--warn-bg); color: var(--warn); }
/* .who is also the sidebar's signed-in block; undo its flex row, rule and padding here. */
.station-tile .who { display: block; min-width: 0; line-height: 1.3; margin: 0; padding: 0; border: 0; font-size: inherit; }
.station-tile .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-tile .who span { font-size: 12px; color: var(--text-3); }
.station-tile .pill { justify-self: start; }
.station-tile .pin { grid-column: 2; font-size: 11px; color: var(--text-3); }
details.more summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "Show"; font-size: 12.5px; color: var(--text-3); }
details.more[open] summary::after { content: "Hide"; }
.pinpad { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pinpad .dots { display: flex; gap: 14px; }
.pinpad .dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.pinpad .dots i.on { background: var(--text); border-color: var(--text); }
.pinpad .keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.pinpad .keys button { height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 20px; font-weight: 500; cursor: pointer; }
.pinpad .keys button:hover { background: var(--panel-3); }
.pinpad .acts { display: flex; gap: 10px; width: 100%; }
.pinpad .acts .btn { flex: 1; height: 42px; font-size: 14px; }

/* Team chat */
.chat-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); height: calc(100vh - 210px); min-height: 480px; }
.chat-side { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.chat-side input { width: 100%; }
.chat-side nav a { display: flex; justify-content: space-between; align-items: center; height: 32px; padding: 0 8px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.chat-side nav a:hover { background: var(--panel-2); color: var(--text); }
.chat-side nav a.on { background: var(--panel-2); color: var(--text); font-weight: 550; }
.chat-side .count { font-size: 11px; font-weight: 600; background: var(--text); color: var(--bg); border-radius: 5px; padding: 0 6px; line-height: 18px; }
.chat-side .count.warn { background: var(--warn-bg); color: var(--warn); }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 58px; }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 18px; }
.msgrow { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 10px 0; }
.msgrow .av { width: 32px; height: 32px; border-radius: 8px; background: var(--panel-3); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.msgrow .mb { min-width: 0; }
.msgrow .mh { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msgrow .mh b { font-weight: 600; font-size: 13.5px; }
.msgrow .mt { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; line-height: 1.5; }
.msgrow.approval .mt { padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 8px; background: var(--panel); }
.msgrow .ma { display: flex; gap: 8px; margin-top: 8px; }
.msgrow .replies { margin-top: 4px; border: 0; background: none; padding: 0; color: var(--text-3); font-size: 12px; cursor: pointer; }
.msgrow .replies:hover { color: var(--text); text-decoration: underline; }
.mention { color: var(--info); font-weight: 500; }
.thread-rule { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; margin: 4px 0; }
.thread-rule::before, .thread-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.composer { border-top: 1px solid var(--line); padding: 12px 18px; }
.composer textarea { min-height: 44px; resize: none; }
.composer .crow { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 10px; }

/* Incidents */
tr.inc { cursor: pointer; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 460px; }

@media (max-width: 860px) {
  .chat-wrap { grid-template-columns: 1fr; height: auto; }
  .chat-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-side nav { display: flex; gap: 4px; overflow-x: auto; }
  .chat-side nav a { flex: none; }
  .chat-log { max-height: 60vh; }
  .facts { grid-template-columns: 1fr; }
}
