/* TxMDT – Windows CAD client look (matches the dispatch console previews) */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 12px "Segoe UI", Tahoma, Arial, sans-serif; color: #111; background: #f0f0f0; }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.titlebar { height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: #fff; border-bottom: 1px solid #cfd3d8; }
.titlebar .logo { width: 14px; height: 14px; background: #2f6db5; }
.titlebar .sep { color: #a9adb3; margin: 0 6px; }
.titlebar .grow { flex: 1; }
.menubar { display: flex; flex-wrap: wrap; background: #f0f0f0; border-bottom: 1px solid #cfd3d8; }
.menubar a, .menubar button { padding: 3px 10px; color: #111; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menubar a:hover, .menubar button:hover, .menubar .on { background: #cce4f7; }
.statusbar { display: flex; background: #e9ebee; border-top: 1px solid #cfd3d8; font-size: 11px; color: #333; margin-top: auto; }
.statusbar span { padding: 2px 10px; border-right: 1px solid #cfd3d8; }
.panel { background: #fff; border: 1px solid #c9ced4; }
.cap { background: linear-gradient(#f7f9fb, #e4e9ef); border-bottom: 1px solid #c9ced4; padding: 3px 8px; font-weight: 700; font-size: 11px; color: #1f4e8c; display: flex; justify-content: space-between; align-items: center; }
.body { padding: 10px; }
.btn { font: 12px "Segoe UI", Tahoma, Arial; padding: 4px 12px; border: 1px solid #8e8f8f; background: linear-gradient(#f6f6f6, #e1e1e1); border-radius: 2px; cursor: pointer; color: #111; }
.btn:hover { background: linear-gradient(#eaf6fd, #d9f0fc); border-color: #3c7fb1; }
.btn.primary { background: linear-gradient(#3d78c9, #2156a8); color: #fff; border-color: #1b4a8f; }
.btn.danger { color: #b00000; }
.btn:disabled { opacity: .5; cursor: default; }
input, select { font: 12px "Segoe UI", Tahoma, Arial; height: 22px; border: 1px solid #9aa3ad; padding: 0 5px; background: #fff; }
input.mono { font-family: Consolas, monospace; text-transform: uppercase; }
label { color: #5f6b76; font-size: 11px; }
.g { width: 100%; border-collapse: collapse; font-size: 11px; }
.g th { background: #e8ebef; border: 1px solid #c9ced4; padding: 3px 6px; text-align: left; font-weight: 600; white-space: nowrap; }
.g td { border: 1px solid #e1e4e8; padding: 3px 6px; vertical-align: middle; }
.g tr:nth-child(even) td { background: #f6f8fa; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 5px; border: 1px solid #9fb2c8; background: #dfe7f1; margin: 1px 2px 1px 0; }
.tag.grant { background: #fff3b0; border-color: #d8c25a; }
.tag.off { background: #eee; color: #888; text-decoration: line-through; }
.err { background: #fdecea; border: 1px solid #c62828; color: #000; padding: 6px 10px; }
.ok { background: #e6f4ea; border: 1px solid #2b8a3e; padding: 6px 10px; }
.mono { font-family: Consolas, "Lucida Console", monospace; }
.muted { color: #5f6b76; }
.center { flex: 1; display: grid; place-items: center; padding: 20px; }
.dialog { width: 100%; max-width: 420px; box-shadow: 0 6px 22px rgba(0,0,0,.25); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.keybox { font: 13px Consolas, monospace; background: #000; color: #2ee6ff; padding: 8px 10px; word-break: break-all; user-select: all; }
.hidden { display: none !important; }
.lcd { background: #000; color: #2ee6ff; font: 700 22px/1 Consolas, monospace; padding: 4px 10px; letter-spacing: 2px; }

/* ---------- map markers ---------- */
.tx-postal { font: 700 9px Arial, sans-serif; color: #fff; background: rgba(20,30,45,.75); border: 1px solid rgba(255,255,255,.55); padding: 0 3px; border-radius: 2px; white-space: nowrap; transform: translate(-50%, -50%); display: inline-block; width: max-content; }
.tx-unit { display: flex; align-items: center; gap: 2px; transform: translate(-6px, -6px); width: max-content; cursor: pointer; }
.tx-unit i { width: 12px; height: 12px; border: 1px solid #000; display: block; }
.tx-unit b { font: 700 10px Arial; background: #fff; border: 1px solid #333; padding: 0 2px; color: #000; }
.tx-unit.sel b { background: #ffe066; }
.tx-unit.emrg i { animation: txblink .5s steps(1) infinite; }
.tx-inc { display: flex; align-items: center; gap: 2px; transform: translate(-9px, -9px); width: max-content; cursor: pointer; }
.tx-inc i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #b00000; background: rgba(255,255,255,.85); display: block; }
.tx-inc.p1 i { background: rgba(255,0,0,.55); }
.tx-inc.sel i { box-shadow: 0 0 0 6px rgba(255,0,0,.25); background: rgba(255,0,0,.75); }
.tx-inc.pend i { animation: txblink 1s steps(1) infinite; }
.tx-inc b { font: 700 10px Arial; color: #fff; background: #b00000; padding: 0 3px; }
.tx-pin { width: 14px; height: 14px; border: 3px solid #1a5fb4; border-radius: 50%; background: #fff; transform: translate(-7px, -7px); }
.tx-night .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
.leaflet-container { background: #a9d3f0; font: inherit; }
@keyframes txblink { 50% { opacity: .15; } }

/* ---------- dispatch console ---------- */
.fkbar { display: flex; flex-wrap: wrap; background: #f0f0f0; border-bottom: 1px solid #cfd3d8; }
.fkbar button { font: 11px Tahoma, Arial, sans-serif; background: transparent; border: 0; border-right: 1px solid #cfd3d8; padding: 4px 9px; cursor: pointer; color: #222; }
.fkbar button:hover { background: #dfe9f5; }
.fkbar button b { margin-right: 4px; }
.cmdbar { display: flex; align-items: center; gap: 6px; padding: 2px 4px; background: #f0f0f0; border-bottom: 1px solid #cfd3d8; }
.cmdbar input { flex: 1; font: 12px Consolas, monospace; text-transform: uppercase; }
.cmdout { font: 11px Consolas, monospace; min-width: 300px; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #2b8a3e; }
.cmdout.bad { color: #c62828; }
.infobar { display: flex; flex-wrap: wrap; background: #f0f0f0; border-bottom: 1px solid #cfd3d8; font-size: 11px; }
.infobar > span { padding: 3px 10px; border-right: 1px solid #cfd3d8; display: flex; align-items: center; gap: 6px; }
.infobar .emrg { background: #e01010; color: #fff; font-weight: 700; animation: txblink 1s steps(1) infinite; }
.infobar .emrg button { animation: none; }
.work { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.g tr.click { cursor: pointer; }
.g tr.sel td:not(.pri):not(.sts) { background: #cde3fb !important; }
.g td.pri { font-weight: 700; text-align: center; color: #fff; }
.g td.sts { font-weight: 700; text-align: center; }
.t-warn { background: #f2d024 !important; font-weight: 700; }
.t-bad { background: #d0201f !important; color: #fff; font-weight: 700; }
.fields { display: grid; grid-template-columns: 70px 1fr 60px 1fr; gap: 3px 6px; align-items: center; padding: 6px; font-size: 11px; }
.fields > label { text-align: right; }
.fields .v { border: 1px solid #9aa3ad; background: #f6f8fa; padding: 1px 4px; font-weight: 700; text-transform: uppercase; min-height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fields .wide { grid-column: span 3; }
.times { display: flex; border-bottom: 1px solid #c9ced4; font-size: 10px; text-align: center; }
.times div { flex: 1; border-right: 1px solid #e1e4e8; padding: 2px 0; }
.times b { display: block; font: 700 11px Consolas, monospace; }
.log { flex: 1; min-height: 90px; border-top: 1px solid #c9ced4; padding: 4px 6px; overflow: auto; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.log .hot { color: #e00; font-weight: 700; }
.msgs { padding: 4px 6px; font: 11px Consolas, monospace; display: flex; flex-direction: column; gap: 2px; max-height: 150px; overflow: auto; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 5000; }
.modal .panel { width: min(640px, 96vw); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.form { display: grid; grid-template-columns: 90px 1fr 70px 1fr; gap: 5px 8px; align-items: center; padding: 10px; }
.form label { text-align: right; }
.form .wide { grid-column: span 3; }
.form input, .form select { width: 100%; }
.emrg-row td { animation: txblink 1s steps(1) infinite; }
.modal.float { background: transparent; pointer-events: none; place-items: start start; padding: 150px 0 0 20px; }
.modal.float .panel { pointer-events: auto; }
