/**
 * 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: #0a0f1c;--surface: #0f172a;--surface-hover: #1a2538;--border: #1e293b;--text: #e5e7eb;--muted: #9ca3af;--accent: #22d3ee;--accent-hover: #06b6d4;--green: #34d399;--yellow: #fbbf24;--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;display:flex;flex-direction:column;align-items:flex-start;gap:10px}.sidebar-logo{height:28px;width:auto}.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:#22d3ee1f;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}.mobile-topbar{display:none;align-items:center;gap:8px;padding:12px 16px;background:var(--surface);border-bottom:1px solid var(--border);font-size:15px;font-weight:700;position:sticky;top:0;z-index:40}.bottom-nav,.bottom-sheet-overlay{display:none}@media (max-width: 760px){.app-layout{flex-direction:column}.sidebar{display:none}.mobile-topbar{display:flex}.shell{padding:20px 16px}.main-content{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}.bottom-nav{display:flex;position:fixed;bottom:0;left:0;right:0;background:var(--surface);border-top:1px solid var(--border);z-index:50;padding-bottom:env(safe-area-inset-bottom,0px)}.bottom-nav-item{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;padding:8px 4px;color:var(--muted);text-decoration:none;background:none;border:none;font-family:inherit;font-size:11px;cursor:pointer}.bottom-nav-item-active{color:var(--accent)}.bottom-nav-icon{font-size:20px;line-height:1}.bottom-sheet-overlay{display:flex;position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;z-index:60;align-items:flex-end}.bottom-sheet{background:var(--surface);border-top:1px solid var(--border);border-radius:16px 16px 0 0;padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px));width:100%;display:flex;flex-direction:column;gap:4px}.bottom-sheet .sidebar-link{white-space:normal}.tabs-scroll{display:none}.tab-select{display:block;width:100%;margin-bottom:16px}.login-card{width:100%;max-width:340px}.topbar{flex-wrap:wrap;gap:10px}.topbar h1{font-size:19px}.stat-tile-value{font-size:22px}.btn,.btn-sm{min-height:44px;padding-left:14px;padding-right:14px}.centered-screen{align-items:flex-start;padding-top:48px}}.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-flex;align-items:center;gap:6px;padding:4px 10px 4px 8px;border-radius:999px;border:1px solid transparent;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}.badge:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex-shrink:0}.badge-green{background:#34d3991f;color:var(--green);border-color:#34d39959}.badge-gray{background:#9ca3af1a;color:var(--muted);border-color:#9ca3af40}.badge-yellow{background:#fbbf241f;color:var(--yellow);border-color:#fbbf2459}.badge-yellow:before{animation:badge-pulse 1.5s ease-in-out infinite}@keyframes badge-pulse{0%,to{opacity:1}50%{opacity:.35}}.badge-red{background:#ef44441f;color:var(--red);border-color:#ef444459}.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;padding:16px}.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,select{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:10px 12px;color:var(--text);font-size:16px;font-family:inherit}input:focus,textarea:focus,select: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:#22d3ee1a}.tabs-wrap{flex-wrap:wrap}.tabs-wrap .tab{flex:0 1 auto}.tabs-scroll{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-mask-image:linear-gradient(to right,black 92%,transparent 100%);mask-image:linear-gradient(to right,black 92%,transparent 100%)}.tabs-scroll::-webkit-scrollbar{display:none}.tabs-scroll .tab{flex:0 0 auto}.tab-select{display:none}.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:#22d3ee1a}.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}.site-card-stats{display:flex;flex-direction:column;gap:6px;margin:10px 0 14px}.site-card-stat-row{display:flex;align-items:center;gap:8px;font-size:12px}.site-card-stat-label{width:30px;flex-shrink:0;color:var(--muted)}.site-card-stat-value{flex-shrink:0;min-width:72px;text-align:right;color:var(--muted)}.mini-bar-track{flex:1;height:5px;background:var(--surface-hover);border-radius:999px;overflow:hidden}.mini-bar-fill{height:100%;background:var(--accent);border-radius:999px}.sparkline{display:block}.sparkline-empty{font-size:12px;height:48px;display:flex;align-items:center}.notice{background:#22d3ee1f;color:var(--text);padding:10px 14px;border-radius:8px;font-size:13px;margin-bottom:16px;border:1px solid rgba(34,211,238,.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}.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}.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:#22d3ee26;color:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px}.avatar{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;color:#0a0f1c;font-weight:700;font-size:13px;flex-shrink:0}.toggle-switch{width:40px;height:22px;border-radius:999px;background:var(--surface-hover);border:1px solid var(--border);position:relative;cursor:pointer;padding:0;flex-shrink:0;transition:background .15s,border-color .15s}.toggle-switch-on{background:var(--accent);border-color:var(--accent)}.toggle-switch-knob{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--text);transition:transform .15s}.toggle-switch-on .toggle-switch-knob{transform:translate(18px);background:#0a0f1c}.toggle-reset{background:none;border:none;color:var(--muted);cursor:pointer;font-size:14px;padding:2px;line-height:1}.toggle-reset:hover{color:var(--accent)}.search-input-wrap{position:relative;margin-bottom:14px;max-width:320px}.search-input-wrap input{width:100%;padding-left:34px}.search-input-icon{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
