/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}:root{--bg-primary: #1A3636;--bg-secondary: #232f2f;--bg-card: #40534C;--bg-hover: #4a5d56;--bg-input: #2a3e3e;--border: #4a5d56;--text-primary: #e8dcc8;--text-secondary: #c4b597;--text-muted: #94a89a;--text-value: #f5f0e8;--accent: #D6BD98;--accent-hover: #e0c9a6;--success: #677D6A;--success-bg: rgba(103, 125, 106, .2);--warning: #D6BD98;--warning-bg: rgba(214, 189, 152, .15);--error: #c97b6b;--error-bg: rgba(201, 123, 107, .15);--info: #677D6A;--info-bg: rgba(103, 125, 106, .15);--radius: 14px;--radius-sm: 10px}*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:var(--bg-primary);color:var(--text-primary);line-height:1.5;-webkit-font-smoothing:antialiased}.app{min-height:100vh;display:flex;flex-direction:column}.header{background:var(--bg-secondary);border-bottom:1px solid var(--border);padding:12px 16px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100}.header-title{font-size:17px;font-weight:600;color:var(--text-value);letter-spacing:-.02em}.nav{display:flex;gap:2px;padding:6px 12px;background:var(--bg-secondary);border-bottom:1px solid var(--border);overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}.nav::-webkit-scrollbar{display:none}.nav-link{display:flex;align-items:center;gap:5px;padding:7px 11px;border-radius:8px;color:var(--text-muted);text-decoration:none;font-size:12px;font-weight:500;white-space:nowrap;transition:all .15s}.nav-link:hover{background:var(--bg-hover);color:var(--text-secondary)}.nav-link.active{background:var(--bg-card);color:var(--text-value)}.main{flex:1;padding:14px;max-width:1080px;margin:0 auto;width:100%}.section-title{font-size:18px;font-weight:700;margin-bottom:14px;display:flex;align-items:center;gap:8px;color:var(--text-value);letter-spacing:-.02em}.status-bar{display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:var(--radius);margin-bottom:14px;font-size:13px;font-weight:600}.status-bar.ok{background:var(--success-bg);color:var(--success)}.status-bar.warning{background:var(--warning-bg);color:var(--warning)}.status-bar.critical{background:var(--error-bg);color:var(--error)}.status-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;animation:pulse 2s ease-in-out infinite}.status-bar.ok .status-dot{background:var(--success)}.status-bar.warning .status-dot{background:var(--warning)}.status-bar.critical .status-dot{background:var(--error)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:18px;margin-bottom:12px}.card-title{font-size:12px;font-weight:600;color:var(--text-muted);margin-bottom:10px;display:flex;align-items:center;gap:6px;text-transform:uppercase;letter-spacing:.06em}.stats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:14px}@media (min-width: 640px){.stats-grid{grid-template-columns:repeat(4,1fr)}}.stat-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:14px}.stat-label{font-size:11px;color:var(--text-muted);margin-bottom:3px;display:flex;align-items:center;gap:5px;text-transform:uppercase;letter-spacing:.04em}.stat-value{font-size:26px;font-weight:700;color:var(--text-value);letter-spacing:-.03em}.stat-sub{font-size:11px;color:var(--text-secondary);margin-top:1px}.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:9999px;font-size:11px;font-weight:600}.badge-success{background:var(--success-bg);color:var(--success)}.badge-warning{background:var(--warning-bg);color:var(--warning)}.badge-error{background:var(--error-bg);color:var(--error)}.badge-info{background:var(--info-bg);color:var(--info)}.health-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}@media (min-width: 640px){.health-grid{grid-template-columns:repeat(4,1fr)}}.health-item{display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--bg-primary);border-radius:var(--radius-sm);font-size:13px}.health-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.health-dot.ok{background:var(--success)}.health-dot.error{background:var(--error)}.health-name{color:var(--text-secondary);flex:1}.health-status{font-weight:600;font-size:12px}.health-status.ok{color:var(--success)}.health-status.error{color:var(--error)}.worker-card{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--bg-primary);border-radius:var(--radius-sm);margin-bottom:6px}.worker-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.worker-dot.online{background:var(--success)}.worker-dot.offline{background:var(--error)}.worker-info{flex:1}.worker-name{font-weight:600;font-size:13px;color:var(--text-value)}.worker-detail{font-size:11px;color:var(--text-muted)}.queue-row{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--border)}.queue-row:last-child{border-bottom:none}.queue-label{font-size:13px;color:var(--text-secondary)}.queue-value{font-size:18px;font-weight:700;color:var(--text-value)}.attention-item{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border-radius:var(--radius-sm);margin-bottom:6px;font-size:13px}.attention-item.critical{background:var(--error-bg);color:var(--error)}.attention-item.warning{background:var(--warning-bg);color:var(--warning)}.attention-icon{flex-shrink:0;margin-top:1px}.activity-item{display:flex;align-items:flex-start;gap:10px;padding:8px 0;border-bottom:1px solid var(--border)}.activity-item:last-child{border-bottom:none}.activity-time{font-size:11px;color:var(--text-muted);white-space:nowrap;min-width:50px;padding-top:1px}.activity-text{font-size:13px;color:var(--text-secondary);flex:1}.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}table{width:100%;border-collapse:collapse;font-size:13px}th{text-align:left;padding:8px 10px;color:var(--text-muted);font-weight:500;font-size:11px;text-transform:uppercase;letter-spacing:.05em;border-bottom:1px solid var(--border)}td{padding:8px 10px;border-bottom:1px solid var(--border);color:var(--text-primary)}tr:hover td{background:var(--bg-hover)}.btn{display:inline-flex;align-items:center;gap:5px;padding:7px 14px;border-radius:var(--radius-sm);font-size:13px;font-weight:500;border:none;cursor:pointer;transition:all .15s}.btn-primary{background:var(--accent);color:var(--bg-primary)}.btn-primary:hover{background:var(--accent-hover)}.btn-secondary{background:var(--bg-hover);color:var(--text-primary);border:1px solid var(--border)}.btn-secondary:hover{background:var(--border)}.btn-danger{background:var(--error-bg);color:var(--error)}.btn-danger:hover{background:#c97b6b40}.btn-sm{padding:4px 10px;font-size:11px}input,select{background:var(--bg-input);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px 12px;color:var(--text-primary);font-size:13px;width:100%;outline:none;transition:border-color .15s}input:focus,select:focus{border-color:var(--accent)}input::placeholder{color:var(--text-muted)}.search-bar{display:flex;gap:8px;margin-bottom:14px}.search-bar input{flex:1}.loading{display:flex;align-items:center;justify-content:center;padding:40px;color:var(--text-muted);font-size:13px}.spinner{width:18px;height:18px;border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin .6s linear infinite;margin-right:8px}@keyframes spin{to{transform:rotate(360deg)}}.skeleton{background:linear-gradient(90deg,var(--bg-card) 25%,var(--bg-hover) 50%,var(--bg-card) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:var(--radius-sm)}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.skeleton-card{height:90px}.skeleton-row{height:40px;margin-bottom:6px}.skeleton-chart{height:120px;margin-bottom:14px}.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}.login-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:32px;max-width:380px;width:100%;text-align:center}.login-card h1{font-size:22px;margin-bottom:6px;color:var(--text-value)}.login-card p{color:var(--text-secondary);margin-bottom:20px;font-size:13px}.pagination{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:14px}.empty{text-align:center;padding:40px;color:var(--text-muted);font-size:13px}.error-state{text-align:center;padding:30px;color:var(--text-secondary);font-size:13px}.error-state button{margin-top:12px}.confirm-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px}.confirm-dialog{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:24px;max-width:360px;width:100%}.confirm-dialog h3{margin-bottom:8px;color:var(--text-value)}.confirm-dialog p{color:var(--text-secondary);font-size:13px;margin-bottom:18px}.confirm-actions{display:flex;gap:8px;justify-content:flex-end}.audit-entry{padding:10px 12px;background:var(--bg-primary);border-radius:var(--radius-sm);margin-bottom:6px}.audit-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:3px}.audit-action{font-weight:600;font-size:13px;color:var(--text-value)}.audit-time{font-size:11px;color:var(--text-muted)}.audit-detail{font-size:12px;color:var(--text-secondary)}.timeseries-chart{width:100%;position:relative}.timeseries-chart svg{border:1px solid var(--border)}.chart-hit:hover{fill:#ffffff0a}.chart-tooltip-float{display:block;position:fixed;transform:translate(-50%,calc(-100% - 14px));pointer-events:none;z-index:50}.chart-container{display:flex;align-items:flex-end;gap:2px;height:160px;padding:0 4px;position:relative}.chart-bar-group{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0;position:relative;cursor:pointer}.chart-bar-group:hover .chart-tooltip{display:block}.chart-bars{display:flex;flex-direction:column;gap:1px;width:100%;height:130px;justify-content:flex-end}.chart-bar{width:100%;min-height:2px;border-radius:2px 2px 0 0;transition:opacity .15s}.chart-bar:hover{opacity:.8}.chart-bar.done{background:var(--success)}.chart-bar.failed{background:var(--error)}.chart-label{font-size:9px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;text-align:center}.chart-tooltip{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius-sm);padding:6px 10px;font-size:11px;line-height:1.5;white-space:nowrap;z-index:10;pointer-events:none;box-shadow:0 4px 12px #0000004d}.chart-tooltip-time{color:var(--text-primary);font-weight:600;margin-bottom:2px}.chart-tooltip-done{color:var(--success)}.chart-tooltip-failed{color:var(--error)}.chart-legend{display:flex;gap:16px;margin-top:8px;font-size:11px;color:var(--text-secondary)}.chart-legend-dot{width:8px;height:8px;border-radius:2px;display:inline-block;margin-right:4px;vertical-align:middle}.detail-row{display:flex;align-items:center;justify-content:space-between;padding:6px 0;font-size:13px}.detail-label{color:var(--text-secondary)}.detail-value{color:var(--text-value);font-weight:600}@media (max-width: 480px){.main{padding:10px}.stat-value{font-size:22px}.stats-grid{gap:8px}.card{padding:14px}.health-grid{grid-template-columns:1fr}.chart-container{height:130px}.chart-bars{height:100px}}
