.card {
    border-radius: 0.75rem;
    border: 1px solid rgb(30 41 59);
    background: rgba(15, 23, 42, 0.6);
    padding: 1rem;
}

.card-title {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

.field {
    display: block;
    font-size: 0.875rem;
    color: rgb(203 213 225);
}

.field>span {
    margin-bottom: 0.25rem;
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgb(148 163 184);
}

.input {
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid rgb(51 65 85);
    background: rgb(2 6 23);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: rgb(241 245 249);
    outline: none;
}

.input:focus {
    border-color: rgb(14 165 233);
}

.btn {
    border-radius: 0.375rem;
    border: 1px solid rgb(51 65 85);
    background: rgb(30 41 59);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn:hover {
    background: rgb(51 65 85);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    border-color: rgb(14 165 233);
    background: rgb(12 74 110);
    color: rgb(224 242 254);
}

.btn-primary:hover {
    background: rgb(7 89 133);
}

.btn-danger {
    border-color: rgb(244 63 94);
    background: rgb(76 5 25);
    color: rgb(254 205 211);
}

.btn-danger:hover {
    background: rgb(136 19 55);
}

.btn-ghost {
    background: transparent;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(30 41 59);
    background: rgb(15 23 42 / 0.8);
}

.filter-bar .field {
    min-width: 10rem;
    flex: 1 1 10rem;
}

.alert {
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
}

.alert-error {
    border: 1px solid rgb(244 63 94);
    background: rgb(76 5 25 / 0.5);
    color: rgb(254 205 211);
}

.alert-info {
    border: 1px solid rgb(14 165 233);
    background: rgb(8 47 73 / 0.5);
    color: rgb(186 230 253);
}

.alert-success {
    border: 1px solid rgb(16 185 129);
    background: rgb(6 78 59 / 0.5);
    color: rgb(167 243 208);
}

.badge-connected {
    border: 1px solid rgb(16 185 129);
    background: rgb(6 78 59);
    color: rgb(167 243 208);
}

.badge-disconnected {
    border: 1px solid rgb(100 116 139);
    background: rgb(30 41 59);
    color: rgb(203 213 225);
}

.badge-error {
    border: 1px solid rgb(244 63 94);
    background: rgb(76 5 25);
    color: rgb(254 205 211);
}

.badge-transport {
    border: 1px solid rgb(99 102 241);
    background: rgb(30 27 75);
    color: rgb(199 210 254);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(2 6 23 / 0.75);
    padding: 1rem;
}

.modal-panel {
    width: min(48rem, 100%);
    max-height: min(90vh, 48rem);
    overflow: auto;
    border-radius: 0.75rem;
    border: 1px solid rgb(51 65 85);
    background: rgb(15 23 42);
    padding: 1rem;
}

.detail-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.detail-item {
    border-radius: 0.5rem;
    border: 1px solid rgb(30 41 59);
    background: rgb(2 6 23);
    padding: 0.65rem 0.75rem;
}

.detail-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgb(148 163 184);
}

.detail-item .value {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: rgb(226 232 240);
    word-break: break-all;
}

.session-logs {
    max-height: 10rem;
    overflow: auto;
    border-radius: 0.5rem;
    border: 1px solid rgb(30 41 59);
    background: rgb(2 6 23);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.menu-wrap {
    display: inline-flex;
    gap: 0.5rem;
    border: 1px solid rgb(51 65 85);
    border-radius: 0.5rem;
    padding: 0.25rem;
    background: rgb(15 23 42);
}

.menu-btn {
    border-radius: 0.375rem;
    border: 1px solid transparent;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    color: rgb(148 163 184);
}

.menu-btn:hover {
    color: rgb(226 232 240);
    background: rgb(30 41 59);
}

.menu-btn-active {
    border-color: rgb(14 165 233);
    background: rgb(12 74 110);
    color: rgb(224 242 254);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-idle {
    border: 1px solid rgb(51 65 85);
    background: rgb(15 23 42);
    color: rgb(148 163 184);
}

.badge-running {
    border: 1px solid rgb(6 182 212);
    background: rgb(8 47 73);
    color: rgb(165 243 252);
}

.badge-pass {
    border: 1px solid rgb(16 185 129);
    background: rgb(6 78 59);
    color: rgb(167 243 208);
}

.badge-fail {
    border: 1px solid rgb(244 63 94);
    background: rgb(76 5 25);
    color: rgb(254 205 211);
}

.th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.td {
    padding: 0.5rem 0.75rem;
    color: rgb(226 232 240);
}

.log-box {
    max-height: 18rem;
    overflow: auto;
    border-radius: 0.5rem;
    border: 1px solid rgb(30 41 59);
    background: rgb(2 6 23);
    padding: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: rgb(203 213 225);
}

[x-cloak] {
    display: none !important;
}

/* —— CoAgent-style collapsible sidebar —— */
.sidebar {
    display: flex;
    flex-direction: column;
    background: rgb(8 12 25);
    border-right: 1px solid rgb(30 41 59);
    transition: width 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-open {
    width: 220px;
}

.sidebar-collapsed {
    width: 48px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid rgb(30 41 59);
    min-height: 48px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: rgb(148 163 184);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    color: rgb(226 232 240);
    background: rgb(30 41 59);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.sidebar-group {
    margin-bottom: 0.25rem;
}

.sidebar-group-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgb(100 116 139);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-group-title:hover {
    color: rgb(148 163 184);
}

.sidebar-group-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem 0.4rem 1.25rem;
    font-size: 0.825rem;
    color: rgb(148 163 184);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
}

.sidebar-item:hover {
    color: rgb(226 232 240);
    background: rgba(30, 41, 59, 0.6);
}

.sidebar-item-active {
    color: rgb(56 189 248);
    background: rgba(14, 165, 233, 0.08);
    border-left-color: rgb(14 165 233);
}

.sidebar-item-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
}

.nav-mark {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgb(148 163 184);
    background: rgb(15 23 42);
    border: 1px solid rgb(51 65 85);
}

.sidebar-item-active .nav-mark {
    color: rgb(186 230 253);
    border-color: rgb(14 165 233 / 0.45);
    background: rgb(12 74 110 / 0.55);
}

.sidebar-group-title .nav-mark {
    opacity: 0.85;
}

.sidebar-footer {
    border-top: 1px solid rgb(30 41 59);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: rgb(100 116 139);
}

.sidebar-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgb(100 116 139);
}

.sidebar-status-on .sidebar-status-dot {
    background: rgb(34 197 94);
}

/* Collapsed sidebar: hide text, show only icons */
.sidebar-collapsed .sidebar-group-title span,
.sidebar-collapsed .sidebar-group-arrow,
.sidebar-collapsed .sidebar-item span:not(.nav-mark):not(.sidebar-item-icon),
.sidebar-collapsed .sidebar-footer span {
    display: none;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar-collapsed .sidebar-group-title {
    justify-content: center;
    padding: 0.35rem 0.5rem;
}

.sidebar-collapsed .sidebar-item {
    justify-content: center;
    padding: 0.4rem 0.5rem;
    border-left: 2px solid transparent;
}

.sidebar-collapsed .sidebar-group-title .sidebar-item-icon,
.sidebar-collapsed .sidebar-item .sidebar-item-icon,
.sidebar-collapsed .sidebar-group-title .nav-mark,
.sidebar-collapsed .sidebar-item .nav-mark {
    display: inline-flex;
}

.sidebar-lab-link {
    display: block;
    padding: 0.35rem 1.25rem;
    font-size: 0.75rem;
    color: rgb(100 116 139);
    text-decoration: none;
}

.sidebar-lab-link:hover {
    color: rgb(148 163 184);
}
/* ===== App shell / atmosphere ===== */
.app-shell {
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(14, 165, 233, 0.12), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(16, 185, 129, 0.08), transparent 50%),
        rgb(2 6 23);
    color: rgb(241 245 249);
}

[x-cloak] {
    display: none !important;
}

.login-viewport {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-panel {
    width: min(28rem, 100%);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgb(186 230 253);
    background: linear-gradient(145deg, rgb(12 74 110), rgb(15 23 42));
    border: 1px solid rgb(56 189 248 / 0.35);
    box-shadow: 0 0 0 4px rgb(14 165 233 / 0.08);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.login-subtitle {
    margin-top: 0.4rem;
    font-size: 0.875rem;
    color: rgb(148 163 184);
}

.login-card {
    backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.78);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgb(30 41 59);
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.topbar-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: rgb(226 232 240);
}

.topbar-meta {
    margin-top: 0.1rem;
    font-size: 0.75rem;
    color: rgb(100 116 139);
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.page-kicker {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgb(56 189 248);
}

.page-title {
    margin-top: 0.15rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: rgb(241 245 249);
}

.page-desc {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: rgb(100 116 139);
}

.stat-card {
    border-radius: 0.75rem;
    border: 1px solid rgb(30 41 59);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.85));
    padding: 0.85rem 1rem;
}

.stat-card .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgb(148 163 184);
}

.stat-card .value {
    margin-top: 0.35rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: rgb(248 250 252);
    font-variant-numeric: tabular-nums;
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: rgb(100 116 139);
    font-size: 0.875rem;
    border: 1px dashed rgb(51 65 85);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.35);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.sidebar-brand-mark {
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgb(186 230 253);
    background: rgb(12 74 110);
    border: 1px solid rgb(14 165 233 / 0.4);
}

.sidebar-brand-text {
    font-size: 0.8rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edge-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.edge-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgb(30 41 59);
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
}

.edge-body {
    width: min(72rem, 100%);
    margin: 0 auto;
    padding: 1.25rem;
}

.badge-idle {
    border: 1px solid rgb(51 65 85);
    background: rgb(30 41 59);
    color: rgb(148 163 184);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-running {
    border: 1px solid rgb(14 165 233);
    background: rgb(12 74 110);
    color: rgb(186 230 253);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* —— UX helpers —— */
.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.field-compact {
    min-width: 8rem;
}

.form-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.table-wrap {
    overflow: auto;
    border-radius: 0.65rem;
    border: 1px solid rgb(30 41 59);
    background: rgba(2, 6, 23, 0.35);
}

.data-table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgb(15 23 42);
    border-bottom: 1px solid rgb(30 41 59);
}

.data-table tbody tr {
    border-top: 1px solid rgb(30 41 59);
    transition: background 0.12s ease;
}

.data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.35);
}

.btn-sm {
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
}

.cap-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid rgb(51 65 85);
    background: rgb(15 23 42);
    color: rgb(148 163 184);
}

.cap-chip-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: rgb(100 116 139);
}

.cap-chip-on {
    border-color: rgb(16 185 129 / 0.45);
    background: rgb(6 78 59 / 0.35);
    color: rgb(167 243 208);
}

.cap-chip-on .cap-chip-dot {
    background: rgb(52 211 153);
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.15);
}

.cap-chip-off {
    border-color: rgb(251 191 36 / 0.35);
    background: rgb(69 26 3 / 0.35);
    color: rgb(253 230 138);
}

.cap-chip-off .cap-chip-dot {
    background: rgb(251 191 36);
}

.toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 80;
    max-width: min(24rem, calc(100vw - 2rem));
}

.toast {
    border-radius: 0.65rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.825rem;
    line-height: 1.4;
    border: 1px solid rgb(51 65 85);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    color: rgb(226 232 240);
}

.toast-success {
    border-color: rgb(16 185 129 / 0.5);
    color: rgb(167 243 208);
}

.toast-error {
    border-color: rgb(244 63 94 / 0.5);
    color: rgb(254 205 211);
}

.toast-info {
    border-color: rgb(14 165 233 / 0.45);
    color: rgb(186 230 253);
}

.toast-enter {
    transition: all 0.2s ease;
}

.toast-enter-start {
    opacity: 0;
    transform: translateY(0.5rem);
}

.toast-enter-end {
    opacity: 1;
    transform: translateY(0);
}

.toast-leave {
    transition: all 0.15s ease;
}

.toast-leave-start {
    opacity: 1;
}

.toast-leave-end {
    opacity: 0;
}

.card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    border-color: rgb(51 65 85);
}

.input:focus {
    border-color: rgb(14 165 233);
    box-shadow: 0 0 0 3px rgb(14 165 233 / 0.12);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-desc {
    font-size: 0.75rem;
    color: rgb(100 116 139);
    line-height: 1.4;
}

.form-section {
    margin-bottom: 1.1rem;
    padding: 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid rgb(30 41 59);
    background: rgba(2, 6, 23, 0.35);
}

.form-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(56 189 248);
    margin-bottom: 0.65rem;
}

.ops-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.ops-block {
    padding: 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid rgb(30 41 59);
    background: rgba(2, 6, 23, 0.35);
}

.row-selected {
    background: rgba(14, 165, 233, 0.08);
}

.callout {
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    font-size: 0.825rem;
    line-height: 1.5;
    color: rgb(203 213 225);
}

.callout strong {
    color: rgb(241 245 249);
    font-weight: 600;
}

.callout-info {
    border: 1px solid rgb(14 165 233 / 0.35);
    background: rgb(8 47 73 / 0.35);
}

.role-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.3rem;
    border-radius: 0.65rem;
    border: 1px solid rgb(51 65 85);
    background: rgb(2 6 23 / 0.55);
}

.role-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    border-radius: 0.45rem;
    padding: 0.5rem 0.4rem;
    font-size: 0.825rem;
    color: rgb(148 163 184);
    background: transparent;
    cursor: pointer;
}

.role-tab:hover {
    color: rgb(226 232 240);
    background: rgb(30 41 59 / 0.6);
}

.role-tab-active {
    border-color: rgb(14 165 233 / 0.45);
    background: rgb(12 74 110 / 0.45);
    color: rgb(224 242 254);
}

.role-tab-active .nav-mark {
    color: rgb(186 230 253);
    border-color: rgb(14 165 233 / 0.45);
    background: rgb(12 74 110 / 0.55);
}

.edge-shell .edge-topbar {
    background: rgba(2, 6, 23, 0.72);
}

.edge-body {
    width: min(56rem, 100%);
}

/* sshportal: xterm overlay */
#xterm-container {
    padding: 8px;
}
#xterm-container .xterm,
#xterm-container .xterm-viewport,
#xterm-container .xterm-screen {
    height: 100% !important;
}
