/* Admin & customer interface styles
   Centralizes overrides that were previously inline in templates. */

html:not(.dark) .admin-interface .text-slate-500,
html:not(.dark) .customer-interface .text-slate-500 {
    color: #334155 !important;
}

html:not(.dark) .admin-interface .text-slate-400,
html:not(.dark) .customer-interface .text-slate-400 {
    color: #475569 !important;
}

html:not(.dark) .admin-interface .text-slate-300,
html:not(.dark) .admin-interface .text-slate-300\/70,
html:not(.dark) .customer-interface .text-slate-300,
html:not(.dark) .customer-interface .text-slate-300\/70 {
    color: #64748b !important;
}

html:not(.dark) .admin-interface .text-slate-200,
html:not(.dark) .admin-interface .text-slate-200\/80,
html:not(.dark) .customer-interface .text-slate-200,
html:not(.dark) .customer-interface .text-slate-200\/80 {
    color: #475569 !important;
}

html:not(.dark) .admin-interface .portal-main .text-slate-100,
html:not(.dark) .customer-interface .portal-main .text-slate-100 {
    color: #0f172a !important;
}

html:not(.dark) .admin-interface .dark\:text-slate-100,
html:not(.dark) .customer-interface .dark\:text-slate-100 {
    color: #0f172a !important;
}

html:not(.dark) .admin-interface .text-sm.font-semibold,
html:not(.dark) .customer-interface .text-sm.font-semibold {
    color: #0f172a !important;
}

.nav-group summary {
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

html.dark {
    color-scheme: dark;
    background-color: #0b1120;
}

html.dark body {
    background-color: #0b1120;
    color: #e2e8f0;
}

html.dark .bg-white {
    background-color: #0f172a !important;
}

html.dark .bg-white\/95 {
    background-color: rgba(15, 23, 42, 0.95) !important;
}

html.dark .bg-slate-50,
html.dark .bg-slate-50\/40 {
    background-color: #0b1220 !important;
}

html.dark .bg-slate-100 {
    background-color: #0f172a !important;
}

html.dark .bg-indigo-50 {
    background-color: rgba(99, 102, 241, 0.18) !important;
}

html.dark .from-white {
    --tw-gradient-from: #0f172a !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(15, 23, 42, 0)) !important;
}

html.dark .via-white {
    --tw-gradient-stops: var(--tw-gradient-from), #0f172a, var(--tw-gradient-to, rgba(15, 23, 42, 0)) !important;
}

html.dark .to-indigo-50 {
    --tw-gradient-to: rgba(99, 102, 241, 0.18) !important;
}

html.dark .bg-sky-50 {
    background-color: rgba(56, 189, 248, 0.18) !important;
}

html.dark .bg-purple-50 {
    background-color: rgba(168, 85, 247, 0.18) !important;
}

html.dark .bg-emerald-50 {
    background-color: rgba(16, 185, 129, 0.18) !important;
}

html.dark .bg-emerald-100 {
    background-color: rgba(16, 185, 129, 0.25) !important;
}

html.dark .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.18) !important;
}

html.dark .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.25) !important;
}

html.dark .bg-rose-50 {
    background-color: rgba(244, 63, 94, 0.18) !important;
}

html.dark .bg-rose-100 {
    background-color: rgba(244, 63, 94, 0.25) !important;
}

html.dark .bg-slate-900\/40 {
    background-color: rgba(15, 23, 42, 0.6) !important;
}

html.dark .hover\:bg-slate-50:hover {
    background-color: rgba(148, 163, 184, 0.12) !important;
}

html.dark .border,
html.dark .border-b,
html.dark .border-t,
html.dark .border-slate-100,
html.dark .border-slate-200 {
    border-color: #1e293b !important;
}

html.dark .border-slate-300 {
    border-color: #334155 !important;
}

html.dark .border-indigo-200 {
    border-color: rgba(99, 102, 241, 0.45) !important;
}

html.dark .border-sky-200 {
    border-color: rgba(56, 189, 248, 0.45) !important;
}

html.dark .border-purple-200 {
    border-color: rgba(168, 85, 247, 0.45) !important;
}

html.dark .border-emerald-200 {
    border-color: rgba(16, 185, 129, 0.45) !important;
}

html.dark .border-amber-200 {
    border-color: rgba(245, 158, 11, 0.45) !important;
}

html.dark .border-rose-200 {
    border-color: rgba(244, 63, 94, 0.45) !important;
}

html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
    border-top-color: #1e293b !important;
}

html.dark .admin-interface table {
    color: #e2e8f0;
}

html.dark .admin-interface thead {
    background-color: #111827 !important;
    color: #cbd5e1;
}

html.dark .admin-interface tbody tr {
    background-color: transparent;
}

html.dark .admin-interface tbody tr:hover {
    background-color: rgba(148, 163, 184, 0.12);
}

html.dark .text-slate-900 {
    color: #f8fafc !important;
}

html.dark .text-slate-800 {
    color: #e2e8f0 !important;
}

.server-card {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    padding: 18px;
}

.server-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.server-card__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.server-hero {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(120deg, #ffffff, #f8fafc);
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.server-hero__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.server-meta {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.server-meta__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
}

.server-meta__value {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.server-meta__sub {
    font-size: 12px;
    color: #64748b;
}

.server-ports__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.server-ports__chip {
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
}

.server-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.server-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-action-feedback {
    font-size: 11px;
}

.status-badge,
.setup-badge {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-running {
    background: #dcfce7;
    color: #15803d;
}

.status-stopped {
    background: #fee2e2;
    color: #b91c1c;
}

.status-provisioning {
    background: #e0f2fe;
    color: #0369a1;
}

.status-pending_setup {
    background: #fef3c7;
    color: #b45309;
}

.status-unknown {
    background: #e2e8f0;
    color: #475569;
}

.setup-ready {
    background: #e0f2fe;
    color: #0369a1;
}

.setup-warning {
    background: #fef3c7;
    color: #b45309;
}

.server-pill {
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
}

.server-pill.is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.server-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.server-tab {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: #fff;
}

.server-tab.is-active {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.btn-primary {
    border-radius: 10px;
    background: #4f46e5;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-primary[disabled],
.btn-ghost[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-ghost[disabled] {
    background: #f8fafc;
}

.btn-ghost {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    background: #fff;
    transition: border 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover {
    border-color: #c7d2fe;
    color: #4338ca;
}

.setup-banner {
    border-radius: 16px;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.setup-banner__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setup-banner__form {
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    padding-top: 16px;
}

.setup-panel {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 16px;
}

.log-output {
    border-radius: 12px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;
    font-size: 12px;
    padding: 16px;
    max-height: 320px;
    overflow-y: auto;
}

.log-output span {
    color: #94a3b8;
    margin-right: 6px;
}

.activity-timeline {
    display: grid;
    gap: 16px;
}

.activity-item {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 16px;
}

.activity-item__header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.activity-item__logs {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
}

.activity-item__logs span {
    color: #94a3b8;
    margin-right: 6px;
}

.activity-item__meta {
    margin-bottom: 8px;
}

.activity-item__output {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    font-size: 11px;
    overflow-x: auto;
}

html.dark .server-card,
html.dark .activity-item {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: none;
}

html.dark .setup-panel {
    background: #0f172a;
    border-color: #1e293b;
}

html.dark .server-hero {
    background: linear-gradient(120deg, #0f172a, #111827);
    border-color: #1e293b;
    box-shadow: none;
}

html.dark .server-tab,
html.dark .btn-ghost {
    background: #0f172a;
    border-color: #1e293b;
    color: #cbd5e1;
}

html.dark .server-tab.is-active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #e0e7ff;
}

html.dark .server-ports__chip {
    background: rgba(99, 102, 241, 0.2);
    color: #e0e7ff;
}

html.dark .server-pill {
    border-color: #1e293b;
    color: #94a3b8;
}

html.dark .setup-banner {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
}

html.dark .activity-item__logs {
    background: #111827;
    color: #cbd5e1;
}

@media (min-width: 1024px) {
    .server-hero {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .server-hero__actions {
        align-items: flex-end;
        text-align: right;
    }

    .setup-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

html.dark .text-slate-700 {
    color: #cbd5e1 !important;
}

html.dark .text-indigo-700 {
    color: #c7d2fe !important;
}

html.dark .text-sky-700 {
    color: #7dd3fc !important;
}

html.dark .text-purple-700 {
    color: #d8b4fe !important;
}

html.dark .text-emerald-700 {
    color: #6ee7b7 !important;
}

html.dark .text-amber-700 {
    color: #fcd34d !important;
}

html.dark .text-rose-700 {
    color: #fda4af !important;
}

html.dark .text-slate-600,
html.dark .text-slate-600\/70 {
    color: #94a3b8 !important;
}

html.dark .text-slate-500,
html.dark .text-slate-400 {
    color: #94a3b8 !important;
}

html.dark .text-slate-300,
html.dark .text-slate-300\/70,
html.dark .text-slate-200,
html.dark .text-slate-200\/80 {
    color: #cbd5e1 !important;
}

html.dark .placeholder-slate-300::placeholder,
html.dark .placeholder-slate-400::placeholder {
    color: #64748b;
}

html.dark .shadow-sm,
html.dark .shadow-md,
html.dark .shadow-lg,
html.dark .shadow-xl,
html.dark .shadow-inner {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
}

:where(button, input[type="button"], input[type="submit"], a.btn, .btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

html.dark :where(button, input[type="button"], input[type="submit"], a.btn, .btn) {
    border-color: #334155;
}

:where(body) :where(
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="url"],
    input[type="tel"],
    select,
    textarea
) {
    min-height: 2.5rem;
    line-height: 1.4;
}

html.dark :where(body) :where(input, select, textarea) {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}

html.dark :where(body) :where(input, select, textarea):focus {
    border-color: #6366f1;
}

html.dark :where(body) :where(select option) {
    background-color: #0f172a;
    color: #e2e8f0;
}

html.dark ::selection {
    background-color: #334155;
    color: #f8fafc;
}

html.dark .admin-interface {
    --nodes-bg: #0b1120;
    --nodes-surface: #111827;
    --nodes-surface-2: #0f172a;
    --nodes-border: #1e293b;
    --nodes-text: #e2e8f0;
    --nodes-muted: #94a3b8;
    --nodes-primary: #6366f1;
    --nodes-success: #22c55e;
    --nodes-warning: #f59e0b;
    --nodes-danger: #f43f5e;
}

.nodes-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nodes-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.nodes-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--nodes-text);
    margin: 0;
}

.nodes-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--nodes-muted);
}

.nodes-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.nodes-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.nodes-stat {
    background: var(--nodes-surface);
    border: 1px solid var(--nodes-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.nodes-stat__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nodes-muted);
}

.nodes-stat__value {
    margin-top: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--nodes-text);
}

.nodes-stat__value--success { color: var(--nodes-success); }
.nodes-stat__value--warning { color: var(--nodes-warning); }
.nodes-stat__value--danger { color: var(--nodes-danger); }

.nodes-alert {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--nodes-border);
    background: rgba(148, 163, 184, 0.12);
    color: var(--nodes-text);
    font-size: 0.875rem;
}

.nodes-alert--success {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

.nodes-alert--danger {
    border-color: rgba(244, 63, 94, 0.45);
    background: rgba(244, 63, 94, 0.18);
    color: #fecdd3;
}

.nodes-alert--warning {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
}

.nodes-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .nodes-layout {
        grid-template-columns: 1fr;
    }
}

.nodes-card {
    background: var(--nodes-surface);
    border: 1px solid var(--nodes-border);
    border-radius: 1rem;
    overflow: hidden;
}

.nodes-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--nodes-border);
}

.nodes-feedback {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0;
}

.nodes-card__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--nodes-text);
}

.nodes-card__subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--nodes-muted);
}

.nodes-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.nodes-table th {
    position: sticky;
    top: 0;
    background: var(--nodes-surface);
    color: var(--nodes-muted);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--nodes-border);
    z-index: 1;
}

.nodes-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--nodes-border);
    height: 3rem;
    color: var(--nodes-text);
}

.nodes-table tr:hover {
    background: rgba(148, 163, 184, 0.08);
}

.nodes-node__name {
    font-weight: 600;
    color: var(--nodes-text);
}

.nodes-node__meta {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--nodes-muted);
}

.nodes-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--nodes-border);
    background: var(--nodes-surface-2);
    font-size: 0.75rem;
    color: var(--nodes-muted);
}

.role-chip--active {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--primary {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.45);
    color: #c7d2fe;
}

.badge--success {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
}

.badge--warning {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

.badge--danger {
    background: rgba(244, 63, 94, 0.18);
    border-color: rgba(244, 63, 94, 0.45);
    color: #fda4af;
}

.badge--neutral {
    background: rgba(148, 163, 184, 0.12);
    border-color: var(--nodes-border);
    color: var(--nodes-muted);
}

.template-os-badge {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge--os-linux {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.badge--os-windows {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.badge--os-both {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.5);
    color: #e2e8f0;
}

.nodes-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
}

.nodes-detail__header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nodes-detail__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--nodes-text);
}

.nodes-detail__subline {
    font-size: 0.8125rem;
    color: var(--nodes-muted);
}

.nodes-detail__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nodes-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.nodes-detail-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--nodes-border);
    background: var(--nodes-surface-2);
}

.nodes-detail-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.nodes-detail-card__title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nodes-muted);
}

.nodes-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nodes-section__title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nodes-muted);
}

.nodes-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.nodes-meta__label {
    font-size: 0.75rem;
    color: var(--nodes-muted);
}

.nodes-meta__value {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--nodes-text);
}

.role-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.role-toggle input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.role-toggle span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--nodes-border);
    background: var(--nodes-surface-2);
    color: var(--nodes-muted);
    font-size: 0.75rem;
    min-height: 2.5rem;
    min-width: 3.5rem;
}

.role-toggle input:checked + span {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
}

.role-toggle input:focus-visible + span {
    outline: 2px solid rgba(99, 102, 241, 0.6);
    outline-offset: 2px;
}

.nodes-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nodes-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}

.nodes-form-grid--single {
    grid-template-columns: 1fr;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label {
    font-size: 0.75rem;
    color: var(--nodes-muted);
}

.form-input {
    min-height: 2.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--nodes-border);
    background: var(--nodes-surface-2);
    color: var(--nodes-text);
    font-size: 0.875rem;
}

.form-input:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
}

.nodes-actions-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn {
    min-height: 2.625rem;
    padding: 0 1.1rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.6);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--nodes-primary);
    color: #f8fafc;
}

.btn--primary:hover {
    background: #4f46e5;
}

.btn--secondary {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.45);
    color: #c7d2fe;
}

.btn--secondary:hover {
    background: rgba(99, 102, 241, 0.2);
}

.btn--tertiary {
    background: transparent;
    border-color: var(--nodes-border);
    color: var(--nodes-muted);
}

.btn--tertiary:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--nodes-text);
}

.btn--danger {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.4);
    color: #fecdd3;
}

.btn--danger:hover {
    background: rgba(244, 63, 94, 0.25);
    color: #fff1f2;
}

.port-ranges-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.port-ranges-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.port-ranges-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--nodes-text);
}

.port-ranges-subtitle {
    color: var(--nodes-muted);
    margin-top: 0.25rem;
}

.port-ranges-meta {
    margin-top: 0.5rem;
    color: var(--nodes-muted);
    font-size: 0.875rem;
}

.port-ranges-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .port-ranges-layout {
        grid-template-columns: 1fr;
    }
}

.port-ranges-table {
    padding: 0 1.5rem 1.5rem;
}

.port-range-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-input--slim {
    min-height: 2.25rem;
    padding: 0.35rem 0.6rem;
}

.port-range-number {
    width: 6rem;
}

.port-range-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-form {
    display: inline-flex;
}

.port-range-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--nodes-muted);
}

.port-range-toggle input {
    accent-color: var(--nodes-primary);
}

.port-range-toggle--large {
    font-size: 0.9rem;
}

:root {
    --ng-bg: #0b1120;
    --ng-surface: #101827;
    --ng-elevated: #162033;
    --ng-border: rgba(148, 163, 184, 0.12);
    --ng-border-strong: rgba(148, 163, 184, 0.24);
    --ng-text: #e2e8f0;
    --ng-text-muted: #94a3b8;
    --ng-primary: #6366f1;
    --ng-success: #22c55e;
    --ng-warning: #f59e0b;
    --ng-danger: #ef4444;
    --ng-info: #38bdf8;
}

html:not(.dark) {
    --ng-bg: #f8fafc;
    --ng-surface: #ffffff;
    --ng-elevated: #f1f5f9;
    --ng-border: rgba(148, 163, 184, 0.2);
    --ng-border-strong: rgba(148, 163, 184, 0.4);
    --ng-text: #0f172a;
    --ng-text-muted: #475569;
    --ng-primary: #4f46e5;
}

.ng-shell {
    background: var(--ng-bg);
    color: var(--ng-text);
}

.ng-layout {
    display: flex;
    min-height: 100vh;
}

.ng-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e1b4b, #0b1120 65%);
    color: #e2e8f0;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ng-sidebar__title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ng-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ng-sidebar__group {
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.35);
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ng-sidebar__group-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(226, 232, 240, 0.72);
    cursor: pointer;
}

.ng-sidebar__chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(226, 232, 240, 0.7);
    border-bottom: 2px solid rgba(226, 232, 240, 0.7);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.ng-sidebar__group[open] .ng-sidebar__chevron {
    transform: rotate(-135deg);
}

.ng-sidebar__items {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ng-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(226, 232, 240, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.ng-sidebar__item:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}

.ng-sidebar__item.is-active {
    background: rgba(99, 102, 241, 0.35);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ng-sidebar__footer {
    margin-top: auto;
    font-size: 12px;
    color: rgba(148, 163, 184, 0.8);
}

.ng-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--ng-bg);
}

.ng-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--ng-border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
}

.ng-topbar__title h1 {
    margin: 0;
    font-size: 24px;
    color: var(--ng-text);
}

.ng-topbar__title p {
    margin: 4px 0 0;
    color: var(--ng-text-muted);
    font-size: 14px;
}

.ng-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ng-icon-button {
    height: 36px;
    width: 36px;
    border-radius: 10px;
    border: 1px solid var(--ng-border);
    background: var(--ng-surface);
    color: var(--ng-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ng-icon-button__dot {
    position: absolute;
    top: 8px;
    right: 8px;
    height: 6px;
    width: 6px;
    background: var(--ng-primary);
    border-radius: 999px;
}

.ng-update-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.ng-update-pill__count {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.25);
    color: #fbbf24;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.ng-user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--ng-border);
    border-radius: 999px;
    padding: 6px 12px;
    background: var(--ng-surface);
    color: var(--ng-text);
    font-size: 13px;
}

.ng-user-menu {
    position: relative;
}

.ng-user-menu > summary {
    list-style: none;
    cursor: pointer;
}

.ng-user-menu > summary::-webkit-details-marker {
    display: none;
}

.ng-user-menu__dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    border-radius: 14px;
    border: 1px solid var(--ng-border);
    background: var(--ng-surface);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.25);
    padding: 10px;
    z-index: 20;
    display: none;
}

.ng-user-menu[open] .ng-user-menu__dropdown {
    display: block;
}

.ng-user-menu__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ng-text-muted);
    letter-spacing: 0.08em;
    padding: 4px 10px 8px;
}

.ng-user-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--ng-text);
    font-size: 13px;
    text-decoration: none;
}

.ng-user-menu__item:hover {
    background: rgba(99, 102, 241, 0.12);
}

.ng-user-button__avatar {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    height: 28px;
    width: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.ng-content {
    padding: 24px 32px 48px;
}

.ng-card {
    background: var(--ng-surface);
    border: 1px solid var(--ng-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
}

.ng-card__header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.ng-card__title {
    margin: 0;
    font-size: 18px;
    color: var(--ng-text);
}

.ng-card__subtitle {
    margin: 6px 0 0;
    color: var(--ng-text-muted);
    font-size: 13px;
}

.ng-card__body {
    padding: 20px 24px 24px;
}

.ng-server-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ng-server-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    background: var(--ng-elevated);
    border: 1px solid var(--ng-border);
}

.ng-server-row__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.ng-server-row__subtitle {
    margin-top: 4px;
    color: var(--ng-text-muted);
    font-size: 13px;
}

.ng-server-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 12px;
}

.ng-server-row__meta-item {
    display: flex;
    gap: 6px;
    font-size: 12px;
    color: var(--ng-text-muted);
}

.ng-server-row__meta-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ng-server-row__meta-value {
    color: var(--ng-text);
    font-weight: 600;
}

.ng-server-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: flex-start;
}

.ng-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ng-button--sm {
    padding: 6px 10px;
    font-size: 11px;
}

.ng-button--primary {
    background: var(--ng-primary);
    color: #fff;
}

.ng-button--primary:hover {
    filter: brightness(1.05);
}

.ng-button--secondary {
    background: rgba(148, 163, 184, 0.12);
    color: var(--ng-text);
    border-color: var(--ng-border);
}

.ng-button--ghost {
    background: transparent;
    color: var(--ng-text-muted);
    border-color: var(--ng-border);
}

.ng-button--ghost:hover {
    color: var(--ng-text);
    border-color: var(--ng-border-strong);
}

.ng-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ng-badge--sm {
    font-size: 10px;
    padding: 3px 8px;
}

.ng-badge--neutral {
    background: rgba(148, 163, 184, 0.12);
    color: var(--ng-text-muted);
}

.ng-badge--success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--ng-success);
}

.ng-badge--warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--ng-warning);
}

.ng-badge--danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--ng-danger);
}

.ng-overflow {
    position: relative;
}

.ng-overflow__trigger {
    border: 1px solid var(--ng-border);
    background: transparent;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    list-style: none;
}

.ng-overflow__trigger::-webkit-details-marker {
    display: none;
}

.ng-overflow__dots {
    display: inline-block;
    width: 16px;
    height: 4px;
    background: radial-gradient(circle, var(--ng-text-muted) 2px, transparent 2px);
    background-size: 6px 4px;
    background-repeat: repeat-x;
}

.ng-overflow__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--ng-surface);
    border: 1px solid var(--ng-border);
    border-radius: 12px;
    padding: 8px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

.ng-overflow__item {
    justify-content: flex-start;
}
