/**
 * 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 .xterm-scroll-area{visibility:hidden}.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{-webkit-user-select:text;user-select:text;white-space:pre}.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}:root{--bg: #0f1117;--surface: #171a23;--surface-hover: #1f232e;--border: #272b36;--text: #e6e8ec;--muted: #8b90a0;--accent: #6366f1;--accent-hover: #4f52d6;--green: #22c55e;--yellow: #eab308;--red: #ef4444}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Segoe UI,system-ui,-apple-system,sans-serif}.shell{max-width:1100px;margin:0 auto;padding:32px 20px}.app-layout{display:flex;min-height:100vh}.sidebar{width:230px;flex-shrink:0;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;padding:20px 14px;position:sticky;top:0;height:100vh}.sidebar-brand{font-size:15px;font-weight:700;padding:0 10px 20px}.sidebar-nav{display:flex;flex-direction:column;gap:2px;flex:1}.sidebar-link{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;color:var(--muted);text-decoration:none;font-size:14px;background:none;border:none;text-align:left;cursor:pointer;font-family:inherit;width:100%}.sidebar-link:hover{background:var(--surface-hover);color:var(--text)}.sidebar-link-active{background:#6366f11f;color:var(--text);font-weight:600}.sidebar-divider{height:1px;background:var(--border);margin:10px 4px}.sidebar-footer{border-top:1px solid var(--border);padding-top:12px;margin-top:12px}.sidebar-user{padding:4px 12px 8px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.main-content{flex:1;min-width:0;overflow-x:hidden}@media (max-width: 760px){.app-layout{flex-direction:column}.sidebar{width:100%;height:auto;position:relative;flex-direction:row;align-items:center;overflow-x:auto;padding:10px 14px}.sidebar-brand{padding:0 10px;white-space:nowrap}.sidebar-nav{flex-direction:row}.sidebar-divider{width:1px;height:24px;margin:0 6px}.sidebar-footer{border-top:none;margin-top:0;padding-top:0;display:flex;align-items:center}.sidebar-user{display:none}.sidebar-link{white-space:nowrap}}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px}.topbar h1{font-size:22px;margin:0}.topbar-actions{display:flex;gap:10px}.card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:20px;margin-bottom:16px}.card h3{margin-top:0;font-size:15px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}.site-card-header{display:flex;justify-content:space-between;align-items:center}.site-card-header h3{color:var(--text);text-transform:none;font-size:17px}.site-link{display:block;color:var(--accent);text-decoration:none;margin:8px 0 16px;font-size:14px}.site-card-actions{display:flex;gap:8px;flex-wrap:wrap}.btn{border:1px solid var(--border);background:var(--surface-hover);color:var(--text);border-radius:8px;padding:9px 16px;font-size:14px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:6px;transition:background .15s}.btn:hover{background:#262b38}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-sm{padding:6px 10px;font-size:13px}.btn-primary{background:var(--accent);border-color:var(--accent)}.btn-primary:hover{background:var(--accent-hover)}.btn-ghost{background:transparent}.btn-danger{background:transparent;border-color:var(--red);color:var(--red)}.btn-danger:hover{background:#ef44441a}.badge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:600}.badge-green{background:#22c55e26;color:var(--green)}.badge-gray{background:#8b90a026;color:var(--muted)}.badge-yellow{background:#eab30826;color:var(--yellow)}.badge-red{background:#ef444426;color:var(--red)}.muted{color:var(--muted)}.empty-state{text-align:center;padding:60px 20px;color:var(--muted)}.centered-screen{min-height:100vh;display:flex;align-items:center;justify-content:center}.login-card{width:340px;display:flex;flex-direction:column;gap:14px}.login-card h1{margin:0;font-size:20px}label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}input,textarea{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:10px 12px;color:var(--text);font-size:14px;font-family:inherit}input:focus,textarea:focus{outline:none;border-color:var(--accent)}.error{background:#ef44441a;color:var(--red);padding:10px 12px;border-radius:8px;font-size:13px}.form-card{display:flex;flex-direction:column;gap:16px;max-width:560px}.tabs{display:flex;gap:8px;margin-bottom:8px}.tab{flex:1;background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:10px;color:var(--muted);cursor:pointer;font-size:14px}.tab-active{border-color:var(--accent);color:var(--text);background:#6366f11a}.tabs-wrap{flex-wrap:wrap}.tabs-wrap .tab{flex:0 1 auto}.template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;margin-bottom:8px}.template-card{text-align:left;background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:14px;cursor:pointer;color:var(--text);display:flex;flex-direction:column;gap:4px}.template-card strong{font-size:14px}.template-card p{font-size:12px;margin:0}.template-card .badge{align-self:flex-start;margin-top:4px}.template-card-active{border-color:var(--accent);background:#6366f11a}.category-card{align-items:center;text-align:center;padding:24px 18px;gap:8px}.category-card strong{font-size:15px}.category-card p{font-size:13px}.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin-bottom:0}.logs{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:14px;font-size:12px;max-height:400px;overflow:auto;white-space:pre-wrap;word-break:break-all}.danger-zone{border-color:#ef44444d}.stat-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-bottom:20px}.stat-tile{text-align:center;padding:18px 12px;margin-bottom:0}.stat-tile-value{font-size:28px;font-weight:800;line-height:1.1}.stat-tile-label{font-size:12px;margin-top:4px;text-transform:uppercase;letter-spacing:.04em}.mini-stats{font-size:12px;margin:6px 0 14px}.sparkline{display:block}.sparkline-empty{font-size:12px;height:48px;display:flex;align-items:center}.notice{background:#6366f11f;color:var(--text);padding:10px 14px;border-radius:8px;font-size:13px;margin-bottom:16px;border:1px solid rgba(99,102,241,.3)}.plans-grid{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}.plan-card{display:flex;flex-direction:column;gap:10px;position:relative}.plan-card-active{border-color:var(--accent)}.plan-current-badge{position:absolute;top:16px;right:16px}.plan-name{color:var(--text);text-transform:none;font-size:18px}.plan-price{font-size:22px;font-weight:700}.plan-features{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}.admin-table,.table{width:100%;border-collapse:collapse;font-size:13px}.admin-table th,.admin-table td,.table th,.table td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--border)}.admin-table th,.table th{color:var(--muted);font-weight:600;text-transform:uppercase;font-size:11px;letter-spacing:.04em}.quota-bar-wrap{margin-bottom:20px}.quota-bar-label{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:var(--muted);margin-bottom:6px}.quota-upgrade-link{color:var(--yellow);text-decoration:none;font-weight:600}.quota-upgrade-link:hover{text-decoration:underline}.quota-bar-track{height:6px;background:var(--surface-hover);border-radius:999px;overflow:hidden}.quota-bar-fill{height:100%;background:var(--accent);border-radius:999px;transition:width .2s}.quota-bar-fill-full{background:var(--red)}.onboarding-steps{display:flex;flex-direction:column;gap:16px;max-width:420px;margin:24px auto;text-align:left}.onboarding-step{display:flex;gap:14px;align-items:flex-start}.onboarding-step strong{color:var(--text)}.onboarding-step p{margin:2px 0 0;font-size:13px}.onboarding-step-num{flex-shrink:0;width:28px;height:28px;border-radius:50%;background:#6366f126;color:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px}
