/* styles/reset.css */
/* Modern CSS Reset */

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
}

body {
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, textarea, select, button {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: inherit;
}

a, button {
    touch-action: manipulation;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* App */
 * { box-sizing: border-box; } html, body { margin: 0; padding: 0; height: 100%; } body { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f6f7f9; color: #111827; -webkit-font-smoothing: antialiased; } ::selection { background: #9477ff; color: #fff; }

/* Login */
 .wrap[coi-scope="Login"]{ min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
 .inner[coi-scope="Login"]{ width: 100%; max-width: 320px; display: flex; flex-direction: column; }
 .brand[coi-scope="Login"]{ font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: #111827; margin-bottom: 4px; }
 .sub[coi-scope="Login"]{ font-size: 13px; color: #6b7280; margin-bottom: 22px; }
 label[coi-scope="Login"]{ font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 7px; }
 input[coi-scope="Login"]{ width: 100%; height: 44px; padding: 0 14px; font-size: 14px; font-family: inherit; border: 1px solid #d8dbe0; border-radius: 6px; background: #fff; outline: none; color: #111827; }
 input[coi-scope="Login"]:focus{ border-color: #9477ff; box-shadow: 0 0 0 3px rgba(148,119,255,0.15); }
 input[coi-scope="Login"]::placeholder{ color: #9ca3af; }
 .err[coi-scope="Login"]{ font-size: 12.5px; color: #dc2626; min-height: 18px; margin-top: 8px; }
 button[coi-scope="Login"]{ width: 100%; height: 44px; margin-top: 14px; font-size: 14px; font-weight: 700; font-family: inherit; background: #9477ff; color: #fff; border: none; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; }
 button[coi-scope="Login"]:hover{ background: #8266ff; }
 button[coi-scope="Login"]:disabled{ opacity: 0.7; cursor: default; }
 .spin[coi-scope="Login"]{ width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
 @keyframes spin { to { transform: rotate(360deg); } }

/* Servers */
 .content[coi-scope="Servers"]{ width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px; }
 .loading[coi-scope="Servers"]{ min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
 .spinner[coi-scope="Servers"]{ width: 38px; height: 38px; border: 3px solid #e5e7eb; border-top-color: #9477ff; border-radius: 50%; animation: spin 0.8s linear infinite; }
 .loading-txt[coi-scope="Servers"]{ font-size: 13px; color: #9ca3af; }
 @keyframes spin { to { transform: rotate(360deg); } } .hero[coi-scope="Servers"]{ margin-bottom: 22px; }
 .hero-row[coi-scope="Servers"]{ display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
 .hero h1[coi-scope="Servers"]{ margin: 0 0 5px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
 .hero p[coi-scope="Servers"]{ margin: 0; font-size: 14px; color: #6b7280; }
 .btn[coi-scope="Servers"]{ border: 1px solid transparent; border-radius: 6px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
 .btn.ghost[coi-scope="Servers"]{ background: #fff; color: #374151; border-color: #e5e7eb; }
 .btn.ghost[coi-scope="Servers"]:hover{ border-color: #d1d5db; background: #fafafa; }
 .overview[coi-scope="Servers"]{ display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
 .ov[coi-scope="Servers"]{ background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 18px; }
 .ov .n[coi-scope="Servers"]{ font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
 .ov .l[coi-scope="Servers"]{ font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; margin-top: 3px; }
 .filters[coi-scope="Servers"]{ display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
 .chip[coi-scope="Servers"]{ padding: 7px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: #fff; border: 1px solid #e5e7eb; color: #6b7280; cursor: pointer; font-family: inherit; }
 .chip[coi-scope="Servers"]:hover{ border-color: #d1d5db; color: #111827; }
 .chip.on[coi-scope="Servers"]{ background: #f3f0ff; border-color: #d6ccff; color: #7c5cff; }
 .grid[coi-scope="Servers"]{ display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
 .card[coi-scope="Servers"]{ background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 17px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
 .card[coi-scope="Servers"]:hover{ border-color: #d1d5db; transform: translateY(-2px); box-shadow: 0 8px 20px -12px rgba(17,24,39,0.25); }
 .card-head[coi-scope="Servers"]{ display: flex; align-items: center; justify-content: space-between; gap: 10px; }
 .card-name[coi-scope="Servers"]{ display: flex; align-items: center; gap: 8px; min-width: 0; }
 .card-name strong[coi-scope="Servers"]{ font-size: 14px; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 .dot[coi-scope="Servers"]{ width: 8px; height: 8px; border-radius: 50%; flex: none; background: #d1d5db; }
 .dot.on[coi-scope="Servers"]{ background: #10b981; }
 .region-badge[coi-scope="Servers"]{ flex: none; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; background: #f3f4f6; border-radius: 20px; padding: 3px 9px; }
 .card-stats[coi-scope="Servers"]{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
 .cell .cn[coi-scope="Servers"]{ font-size: 16px; font-weight: 700; color: #111827; }
 .cell .cl[coi-scope="Servers"]{ font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #9ca3af; }
 .card-foot[coi-scope="Servers"]{ display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid #f3f4f6; }
 .card-mode[coi-scope="Servers"]{ font-size: 12px; color: #6b7280; }
 .card-open[coi-scope="Servers"]{ font-size: 12px; font-weight: 600; color: #9477ff; }
 .gate[coi-scope="Servers"]{ min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
 .gate p[coi-scope="Servers"]{ color: #6b7280; font-size: 14px; }
 .btn.primary[coi-scope="Servers"]{ background: #9477ff; color: #fff; }
 .btn.primary[coi-scope="Servers"]:hover{ background: #8266ff; }
 @media (max-width: 640px) {
.content[coi-scope="Servers"]{ padding: 18px; }
}


/* Detail */
 .content[coi-scope="Detail"]{ width: 100%; max-width: 1200px; margin: 0 auto; padding: 26px 32px 48px; }
 .btn[coi-scope="Detail"]{ border: 1px solid transparent; border-radius: 6px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
 .btn.ghost[coi-scope="Detail"]{ background: #fff; color: #374151; border-color: #e5e7eb; }
 .btn.ghost[coi-scope="Detail"]:hover{ border-color: #d1d5db; background: #fafafa; }
 .btn.danger[coi-scope="Detail"]{ background: #fff; color: #dc2626; border-color: #fecaca; }
 .btn.danger[coi-scope="Detail"]:hover{ background: #fef2f2; border-color: #dc2626; }
 .btn.primary[coi-scope="Detail"]{ background: #9477ff; color: #fff; border-color: #9477ff; }
 .btn.primary[coi-scope="Detail"]:hover{ background: #8266ff; }
 .crumbs[coi-scope="Detail"]{ display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #9ca3af; margin-bottom: 18px; }
 .crumbs a[coi-scope="Detail"]{ color: #6b7280; cursor: pointer; text-decoration: none; }
 .crumbs a[coi-scope="Detail"]:hover{ color: #111827; }
 .crumbs .cur[coi-scope="Detail"]{ color: #111827; font-weight: 600; }
 .page-head[coi-scope="Detail"]{ display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
 .ph-title[coi-scope="Detail"]{ display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
 .ph-meta[coi-scope="Detail"]{ display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12.5px; color: #6b7280; flex-wrap: wrap; }
 .ph-meta .sep[coi-scope="Detail"]{ color: #d1d5db; }
 .ph-meta .addr[coi-scope="Detail"]{ font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 5px; padding: 2px 8px; color: #374151; }
 .toolbar[coi-scope="Detail"]{ display: flex; gap: 8px; flex-wrap: wrap; }
 .pill[coi-scope="Detail"]{ display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 20px; border: 1px solid; }
 .pill .pd[coi-scope="Detail"]{ width: 7px; height: 7px; border-radius: 50%; }
 .pill.ok[coi-scope="Detail"]{ background: #ecfdf5; border-color: #bbf7d0; color: #047857; }
 .pill.ok .pd[coi-scope="Detail"]{ background: #10b981; }
 .pill.warn[coi-scope="Detail"]{ background: #fffbeb; border-color: #fde68a; color: #b45309; }
 .pill.warn .pd[coi-scope="Detail"]{ background: #f59e0b; }
 .pill.err[coi-scope="Detail"]{ background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
 .pill.err .pd[coi-scope="Detail"]{ background: #ef4444; }
 .pill.off[coi-scope="Detail"]{ background: #f9fafb; border-color: #e5e7eb; color: #6b7280; }
 .pill.off .pd[coi-scope="Detail"]{ background: #9ca3af; }
 .err-banner[coi-scope="Detail"]{ display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
 .kpis[coi-scope="Detail"]{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
 .kpi[coi-scope="Detail"]{ background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 18px; }
 .kpi .label[coi-scope="Detail"]{ font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; margin-bottom: 9px; }
 .kpi .value[coi-scope="Detail"]{ font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: #111827; line-height: 1.1; }
 .kpi .value .unit[coi-scope="Detail"]{ font-size: 13px; font-weight: 600; color: #9ca3af; margin-left: 4px; letter-spacing: 0; }
 .kpi .sub[coi-scope="Detail"]{ font-size: 11.5px; color: #9ca3af; margin-top: 7px; }
 @media (max-width: 960px) {
.kpis[coi-scope="Detail"]{ grid-template-columns: repeat(2, 1fr); }
}
 .panel[coi-scope="Detail"]{ background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px 22px; margin-bottom: 16px; }
 .panel h2[coi-scope="Detail"]{ margin: 0 0 16px; font-size: 15px; font-weight: 700; }
 .panel-head[coi-scope="Detail"]{ display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
 .count-badge[coi-scope="Detail"]{ font-size: 11px; font-weight: 700; color: #6b7280; background: #f3f4f6; border-radius: 20px; padding: 2px 9px; margin-left: 7px; }
 .metric-grid[coi-scope="Detail"]{ display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
 .metric[coi-scope="Detail"]{ background: #fafbfc; border: 1px solid #eef0f2; border-radius: 7px; padding: 11px 13px; }
 .metric .label[coi-scope="Detail"]{ font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #9ca3af; margin-bottom: 5px; }
 .metric .value[coi-scope="Detail"]{ font-size: 15px; font-weight: 700; color: #111827; font-variant-numeric: tabular-nums; }
 .tbl-wrap[coi-scope="Detail"]{ overflow-x: auto; margin: 0 -22px -20px; padding: 0 22px; }
 table[coi-scope="Detail"]{ width: 100%; border-collapse: collapse; font-size: 13px; }
 th[coi-scope="Detail"],td[coi-scope="Detail"]{ padding: 11px 12px; text-align: left; border-bottom: 1px solid #f0f1f3; white-space: nowrap; }
 tbody tr[coi-scope="Detail"]:last-child td{ border-bottom: none; }
 th[coi-scope="Detail"]{ font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: #9ca3af; font-weight: 600; }
 td[coi-scope="Detail"]{ color: #374151; }
 td.strong[coi-scope="Detail"]{ color: #111827; font-weight: 600; }
 tbody tr[coi-scope="Detail"]:hover{ background: #fafafa; }
 .mono[coi-scope="Detail"]{ font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
 .num[coi-scope="Detail"]{ font-variant-numeric: tabular-nums; }
 .lvl[coi-scope="Detail"]{ display: flex; align-items: center; gap: 8px; }
 .lvl-track[coi-scope="Detail"]{ width: 54px; height: 4px; border-radius: 2px; background: #eef0f2; overflow: hidden; }
 .lvl-fill[coi-scope="Detail"]{ height: 100%; background: #9477ff; border-radius: 2px; }
 .row-actions[coi-scope="Detail"]{ display: flex; gap: 6px; justify-content: flex-end; }
 .col-actions[coi-scope="Detail"]{ text-align: right; }
 .mini[coi-scope="Detail"]{ padding: 4px 9px; font-size: 11px; border-radius: 6px; }
 .empty[coi-scope="Detail"]{ padding: 42px; text-align: center; color: #9ca3af; font-size: 13px; }
 .loading[coi-scope="Detail"]{ min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
 .spinner[coi-scope="Detail"]{ width: 38px; height: 38px; border: 3px solid #e5e7eb; border-top-color: #9477ff; border-radius: 50%; animation: spin 0.8s linear infinite; }
 .loading-txt[coi-scope="Detail"]{ font-size: 13px; color: #9ca3af; }
 @keyframes spin { to { transform: rotate(360deg); } } .gate[coi-scope="Detail"]{ min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
 .gate p[coi-scope="Detail"]{ color: #6b7280; font-size: 14px; }
 .overlay[coi-scope="Detail"]{ position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
 .modal[coi-scope="Detail"]{ background: #fff; border-radius: 10px; padding: 26px 28px; width: 100%; max-width: 400px; box-shadow: 0 24px 60px -20px rgba(0,0,0,0.4); }
 .modal h3[coi-scope="Detail"]{ margin: 0 0 16px; font-size: 17px; font-weight: 700; }
 .field[coi-scope="Detail"]{ display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
 .field label[coi-scope="Detail"]{ font-size: 12px; font-weight: 600; color: #6b7280; }
 input[type=text][coi-scope="Detail"]{ width: 100%; padding: 11px 13px; font-size: 14px; font-family: inherit; border: 1px solid #e5e7eb; border-radius: 8px; outline: none; color: #111827; }
 input[type=text][coi-scope="Detail"]:focus{ border-color: #9477ff; }
 .modal-actions[coi-scope="Detail"]{ display: flex; gap: 10px; }
 .grow[coi-scope="Detail"]{ flex: 1; }
 .colors[coi-scope="Detail"]{ display: flex; gap: 8px; margin-bottom: 16px; }
 .swatch[coi-scope="Detail"]{ width: 36px; height: 30px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
 .swatch.on[coi-scope="Detail"]{ border-color: #111827; }
 @media (max-width: 640px) {
.content[coi-scope="Detail"]{ padding: 18px; }
}


/* NavBar */
 .topbar[coi-scope="NavBar"]{ display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 20; }
 .brand[coi-scope="NavBar"]{ display: flex; align-items: center; gap: 11px; }
 .logo[coi-scope="NavBar"]{ width: 32px; height: 32px; border-radius: 7px; background: #9477ff; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; }
 .t[coi-scope="NavBar"]{ font-size: 15px; font-weight: 800; }
 .s[coi-scope="NavBar"]{ font-size: 11px; color: #9ca3af; }
 .logout[coi-scope="NavBar"]{ border: 1px solid #e5e7eb; background: #fff; color: #374151; border-radius: 7px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
 .logout[coi-scope="NavBar"]:hover{ border-color: #d1d5db; background: #fafafa; }
 .right[coi-scope="NavBar"]{ display: flex; align-items: center; gap: 14px; }
 .ver[coi-scope="NavBar"]{ font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10.5px; color: #c3c7cf; }


/* TimeSeriesChart */
 .ts-card[coi-scope="TimeSeriesChart"]{ background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px 22px; margin-bottom: 18px; }
 .ts-head[coi-scope="TimeSeriesChart"]{ display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
 .ts-title[coi-scope="TimeSeriesChart"]{ font-size: 15px; font-weight: 700; color: #111827; }
 .ts-stats[coi-scope="TimeSeriesChart"]{ display: flex; gap: 22px; }
 .ts-stat[coi-scope="TimeSeriesChart"]{ display: flex; align-items: baseline; gap: 7px; }
 .ts-stat .k[coi-scope="TimeSeriesChart"]{ font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #9ca3af; }
 .ts-stat .v[coi-scope="TimeSeriesChart"]{ font-size: 14px; font-weight: 700; color: #111827; font-variant-numeric: tabular-nums; }
 .ts-body[coi-scope="TimeSeriesChart"]{ display: flex; }
 .ts-ylab[coi-scope="TimeSeriesChart"]{ position: relative; width: 38px; height: 210px; flex: none; }
 .ts-ylab span[coi-scope="TimeSeriesChart"]{ position: absolute; right: 10px; transform: translateY(50%); font-size: 10.5px; color: #9ca3af; font-variant-numeric: tabular-nums; }
 .ts-main[coi-scope="TimeSeriesChart"]{ flex: 1; min-width: 0; }
 .ts-plot[coi-scope="TimeSeriesChart"]{ position: relative; height: 210px; }
 .ts-grid[coi-scope="TimeSeriesChart"]{ position: absolute; left: 0; right: 0; height: 1px; background: #f2f3f5; }
 .ts-base[coi-scope="TimeSeriesChart"]{ position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: #e5e7eb; }
 .ts-cols[coi-scope="TimeSeriesChart"]{ position: absolute; inset: 0; display: flex; align-items: flex-end; }
 .ts-col[coi-scope="TimeSeriesChart"]{ flex: 1 1 0; min-width: 1px; height: 100%; position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; border-radius: 3px; }
 .ts-col[coi-scope="TimeSeriesChart"]:hover{ background: rgba(148, 119, 255, 0.07); }
 .ts-bar[coi-scope="TimeSeriesChart"]{ width: 100%; max-width: 24px; background: #9477ff; border-radius: 4px 4px 0 0; }
 .ts-col[coi-scope="TimeSeriesChart"]:hover .ts-bar{ background: #7c5cff; }
 .ts-tip[coi-scope="TimeSeriesChart"]{ position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px); display: none; flex-direction: column; align-items: center; gap: 1px; background: #111827; border-radius: 6px; padding: 6px 10px; white-space: nowrap; pointer-events: none; z-index: 10; }
 .ts-col[coi-scope="TimeSeriesChart"]:hover .ts-tip{ display: flex; }
 .ts-tip .v[coi-scope="TimeSeriesChart"]{ font-size: 12px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
 .ts-tip .t[coi-scope="TimeSeriesChart"]{ font-size: 10.5px; color: #9ca3af; }
 .ts-xlab[coi-scope="TimeSeriesChart"]{ display: flex; justify-content: space-between; margin-top: 8px; }
 .ts-xlab span[coi-scope="TimeSeriesChart"]{ font-size: 10.5px; color: #9ca3af; font-variant-numeric: tabular-nums; }
 .ts-empty[coi-scope="TimeSeriesChart"]{ height: 210px; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 13px; }


