/* ==========================================================================
   NETGRID NSoT - SOFT LIGHT DASHBOARD DESIGN SYSTEM
   Palette Tokens: Off-white Canvas (#EBEEF2), Pure White (#FFFFFF),
   Pastel Mint (#D4F0EB), Pastel Cyan (#E0F2FE), Stark Black (#0F1115)
   Typography: Poppins & JetBrains Mono | Radii: 20px - 24px Cards, 9999px Pills
   ========================================================================== */

:root {
    /* Soft Light Dashboard Palette (Extracted from reference design) */
    --bg-body: #EBEEF2;                /* Outer light grey framing backdrop */
    --bg-canvas: #FFFFFF;              /* Main workstation canvas surface */
    --bg-canvas-subtle: #F8FAFC;       /* Soft light secondary tint */
    --bg-card: #FFFFFF;                /* Pure white surface for cards & tables */
    --bg-card-subtle: #F8FAFC;         /* Light card header & sub-panel tint */
    --bg-card-hover: #F1F5F9;          /* Subtle row & item hover */

    /* Pastel Mint & Cyan Data Panels (Reference "Your activity" Card) */
    --pastel-mint: #D4F0EB;            /* Signature pastel mint panel */
    --pastel-mint-hover: #C6ECE5;      /* Mint hover tint */
    --pastel-mint-border: #BFE5DD;      /* Mint container border */
    --pastel-mint-text: #0F5144;        /* Deep contrast forest teal for text on mint */
    --pastel-mint-pill: #D4F0EB;        /* Active pill navigation background */

    --pastel-cyan: #E0F2FE;            /* Soft pastel cyan accent */
    --pastel-cyan-border: #BAE6FD;      /* Cyan border */
    --pastel-cyan-text: #0369A1;        /* Deep contrast cyan text */

    --pastel-lavender: #EDE9FE;        /* Soft pastel lavender */
    --pastel-lavender-text: #5B21B6;   /* Deep lavender text */

    /* Stark Black Interactive Buttons & Primary Elements */
    --stark-black: #0F1115;            /* Pure stark dark interactive black */
    --stark-black-hover: #22252A;      /* Elevated stark dark hover */
    --stark-black-active: #050608;     /* Active clicked state */
    --stark-black-text: #FFFFFF;       /* Crisp white text on black */

    /* Crisp Borders & Light Dividers */
    --border-light: #F1F5F9;           /* Ultra-subtle divider */
    --border-default: #E2E8F0;         /* Standard card & container border */
    --border-strong: #CBD5E1;          /* Emphasized border line */

    /* High-Contrast Typography & Hierarchy */
    --text-main: #0F172A;              /* Deep slate primary headings & text */
    --text-body: #1E293B;              /* Primary body copy */
    --text-muted: #64748B;             /* Refined slate metadata & labels */
    --text-subtle: #94A3B8;            /* Subtle placeholders & separators */
    --text-white: #FFFFFF;

    /* Semantics & Status Accents */
    --success: #10B981;                /* Emerald active indicator */
    --success-light: #ECFDF5;
    --success-border: #A7F3D0;
    --success-text: #065F46;

    --danger: #EF4444;                 /* Clean red */
    --danger-light: #FEF2F2;
    --danger-border: #FECACA;
    --danger-text: #991B1B;

    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --warning-border: #FDE68A;
    --warning-text: #92400E;

    --info: #0284C7;
    --info-light: #F0F9FF;
    --info-border: #BAE6FD;
    --info-text: #0369A1;

    /* Spacing Rhythm (Strict 4pt / 8pt Scale) */
    --space-2: 2px;
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;
    --space-40: 40px;
    --space-48: 48px;

    /* Soft Rounded Corners & Pill Radii (Reference Spec) */
    --radius-full: 9999px;             /* Strict pill-shapes for buttons & toggles */
    --radius-xl: 26px;                 /* Outer layout canvas */
    --radius-lg: 20px;                 /* Main layout cards & data tables */
    --radius-md: 16px;                 /* Sub-panels & stat cards */
    --radius-sm: 8px;                  /* Grid cells & micro tags */

    /* Soft Diffuse Shadows */
    --shadow-canvas: 0 16px 40px -8px rgba(15, 23, 42, 0.06), 0 0 1px 1px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.04), 0 1px 3px -1px rgba(15, 23, 42, 0.02);
    --shadow-floating: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    --shadow-pill: 0 2px 6px -1px rgba(15, 23, 42, 0.06);
    --shadow-modal: 0 24px 60px -12px rgba(15, 23, 42, 0.2);

    /* Geometric Sans-Serif Typography */
    --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body.app-body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Outer Soft Light Frame & Canvas */
.app-frame {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-16) var(--space-20) var(--space-24) var(--space-20);
    width: 100%;
    margin: 0;
}

.app-canvas {
    flex: 1;
    background-color: var(--bg-canvas);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-canvas);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* ==========================================================================
   Header Trio Bar: Split 3-Way Floating Pill System
   ========================================================================== */
.header-trio-bar,
.app-header {
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0 0 var(--space-16) 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    position: sticky;
    top: var(--space-16);
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-16);
}

/* Base Pill Card: Exact 60px Height Retaining Header Geometry */
.header-pill-card {
    background: #FFFFFF;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-floating);
    height: 60px;
    min-height: 60px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    transition: all 180ms ease;
}

/* 1. Left Corner Pill Card: Brand Group */
.header-brand-card {
    justify-self: start;
    padding: 0 18px 0 11px;
    gap: var(--space-10);
    flex-shrink: 0;
}

.header-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-default);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-decoration: none;
    transition: all 180ms ease;
    flex-shrink: 0;
}

.header-circle-btn:hover {
    background: var(--pastel-mint);
    border-color: var(--pastel-mint-border);
    color: var(--pastel-mint-text);
    transform: scale(1.05);
}

.header-circle-icon {
    width: 17px;
    height: 17px;
}

.header-title-stack {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.header-title-link {
    text-decoration: none;
    color: var(--text-main);
}

.header-title-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    line-height: 1;
}

.header-scope-pill {
    background: var(--pastel-cyan);
    border: 1px solid var(--pastel-cyan-border);
    color: var(--pastel-cyan-text);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

/* 2. Center Pill Card: Navigation Menu Bar */
.header-nav-card {
    justify-self: center;
    padding: 0 10px;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

/* Merging Folder Tab Bridge connecting active tab to main content card */
.nav-folder-tab-bridge {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
    will-change: transform;
    opacity: 1;
    transition: opacity 180ms ease;
}

.folder-tab-svg {
    display: block;
    overflow: visible;
}

.folder-tab-fill {
    fill: #FFFFFF;
}

.folder-tab-stroke {
    fill: none;
    stroke: var(--border-default);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Dedicated spacing to left and right of every menu selection to prevent scoop overlap */
.floating-pill-list {
    position: relative;
    z-index: 6;
}

.floating-pill-list,
.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 28px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 14px;
    margin: 0;
}

.floating-pill-list::-webkit-scrollbar {
    display: none;
}

.nav-pill,
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 180ms ease;
    white-space: nowrap;
    height: 40px;
    box-sizing: border-box;
    position: relative;
    z-index: 8;
}

.nav-pill:hover,
.nav-link:hover {
    background: var(--bg-card-subtle);
    color: var(--text-main);
    border-color: var(--border-default);
}

/* Active Pill Selection: Pastel Mint Fill with Deep Text */
.nav-pill.active,
.nav-link.active {
    background: var(--pastel-mint);
    color: var(--pastel-mint-text);
    border-color: var(--pastel-mint-border);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(15, 81, 68, 0.08);
    position: relative;
    z-index: 8;
}

.nav-pill-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* 3. Right Corner Pill Card: Notifications & User Profile */
.header-user-card {
    justify-self: end;
    padding: 0 11px;
    gap: var(--space-8);
    flex-shrink: 0;
    position: relative;
}

.header-action-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Notification Action Button (Left of Profile) */
.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-default);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
    transition: all 180ms ease;
    padding: 0;
}

.header-icon-btn:hover {
    background: var(--pastel-mint);
    border-color: var(--pastel-mint-border);
    color: var(--pastel-mint-text);
    transform: scale(1.05);
}

.header-btn-svg {
    width: 17px;
    height: 17px;
}

.notif-badge-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

/* Subtle Vertical Divider between Bell & Profile */
.header-user-sep {
    width: 1px;
    height: 22px;
    background: var(--border-default);
    margin: 0 1px;
}

/* Circle Profile Button (Super Admin "SA") */
.header-profile-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--stark-black);
    color: var(--stark-black-text);
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 180ms ease;
    padding: 0;
    box-shadow: 0 2px 6px rgba(15, 17, 21, 0.12);
}

.header-profile-btn:hover {
    background: var(--stark-black-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(15, 17, 21, 0.25);
    border-color: var(--pastel-mint-border);
}

.profile-avatar-initials {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-family: var(--font-sans);
    line-height: 1;
}

/* Universal Popover Dropdown */
.header-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #FFFFFF;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 160ms ease, transform 160ms cubic-bezier(0.16, 1, 0.3, 1), visibility 160ms ease;
    z-index: 1000;
    overflow: hidden;
}

.header-dropdown-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Notifications Dropdown */
.notif-dropdown {
    width: 350px;
}

.dropdown-header {
    padding: var(--space-12) var(--space-16);
    background: var(--bg-card-subtle);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.dropdown-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.dropdown-count-badge {
    background: var(--pastel-cyan);
    border: 1px solid var(--pastel-cyan-border);
    color: var(--pastel-cyan-text);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
}

.dropdown-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: color 140ms ease;
}

.dropdown-action-btn:hover {
    color: var(--text-main);
}

.notif-items-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-12);
    padding: var(--space-12) var(--space-16);
    border-bottom: 1px solid var(--border-light);
    transition: background 140ms ease;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--bg-card-hover);
}

.notif-item.unread {
    background: #F8FAFD;
}

.notif-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon-wrap svg {
    width: 15px;
    height: 15px;
}

.notif-icon-mint {
    background: var(--pastel-mint);
    color: var(--pastel-mint-text);
    border: 1px solid var(--pastel-mint-border);
}

.notif-icon-cyan {
    background: var(--pastel-cyan);
    color: var(--pastel-cyan-text);
    border: 1px solid var(--pastel-cyan-border);
}

.notif-icon-dark {
    background: var(--stark-black);
    color: #FFFFFF;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.notif-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
    word-break: break-word;
}

.notif-meta {
    font-size: 10.5px;
    color: var(--text-subtle);
    margin-top: 4px;
}

.notif-actor {
    color: var(--text-body);
    font-weight: 600;
}

/* Profile Dropdown */
.profile-dropdown {
    width: 270px;
}

.profile-card-header {
    padding: var(--space-16);
    display: flex;
    align-items: center;
    gap: var(--space-12);
    background: #FFFFFF;
}

.profile-avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--stark-black);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15, 17, 21, 0.15);
}

.profile-meta {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.profile-email {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role-badge {
    display: inline-block;
    margin-top: 5px;
    background: var(--pastel-mint);
    border: 1px solid var(--pastel-mint-border);
    color: var(--pastel-mint-text);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
}

.profile-menu-section {
    padding: var(--space-10) var(--space-16);
}

.profile-status-row {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.profile-menu-actions {
    padding: var(--space-8);
}

.dropdown-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-10);
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-body);
    cursor: pointer;
    transition: all 140ms ease;
    text-align: left;
}

.dropdown-menu-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.dropdown-menu-item.logout-item {
    color: var(--danger-text);
}

.dropdown-menu-item.logout-item:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.menu-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==========================================================================
   Swup.js Transition Engine & Container
   ========================================================================== */
#swup {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.transition-slide,
.transition-fade {
    transition: opacity 140ms ease;
    opacity: 1;
    will-change: opacity;
}

/* Seamless, flicker-free cross-fade during Swup navigation */
html.is-animating .transition-slide,
html.is-animating .transition-fade {
    opacity: 0;
}

/* ==========================================================================
   Page Layout & Container
   ========================================================================== */
.page-body {
    flex: 1;
    padding: var(--space-24) var(--space-32);
}

.container {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-24);
    gap: var(--space-16);
    flex-wrap: wrap;
}

/* Soft Breadcrumbs */
.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: 500;
    margin-bottom: var(--space-8);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 140ms;
}

.breadcrumb a:hover {
    color: var(--text-main);
}

.breadcrumb-separator {
    color: var(--text-subtle);
    font-size: 10px;
}

.breadcrumb-current {
    color: var(--text-main);
    font-weight: 600;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    line-height: 1.25;
}

.page-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: var(--space-4);
    line-height: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

/* ==========================================================================
   Stats Grid (Soft Light Telemetry Cards)
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--space-16);
    margin-bottom: var(--space-24);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-20) var(--space-24);
    box-shadow: var(--shadow-card);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-floating);
    border-color: var(--border-strong);
}

.stat-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-top: var(--space-6);
    line-height: 1.2;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--space-6);
}

/* ==========================================================================
   Cards & Layout Containers (20px - 24px Border Radius)
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: var(--space-24);
}

.card-header {
    padding: var(--space-18) var(--space-24);
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-light);
}

.card-header.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-16);
    flex-wrap: wrap;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: var(--space-2);
}

.card-body {
    padding: var(--space-24);
}

.card-body.no-padding {
    padding: 0;
}

/* Signature Pastel Mint Feature Panel ("Your activity" Card Aesthetic) */
.card-pastel-mint {
    background: var(--pastel-mint);
    border: 1px solid var(--pastel-mint-border);
}

.card-pastel-mint .card-header {
    background: transparent;
    border-bottom-color: rgba(191, 229, 221, 0.7);
}

.card-pastel-mint .card-title {
    color: var(--pastel-mint-text);
}

.card-pastel-mint .card-subtitle {
    color: rgba(15, 81, 68, 0.8);
}

/* ==========================================================================
   Buttons (Stark Black Primary & Strict Pill-Shapes 9999px)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    padding: 9px 20px;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    user-select: none;
}

/* Stark Black Interactive Primary Button */
.btn-primary {
    background-color: var(--stark-black);
    color: var(--stark-black-text);
    border-color: var(--stark-black);
    box-shadow: 0 2px 6px rgba(15, 17, 21, 0.15);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--stark-black-hover);
    border-color: var(--stark-black-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 17, 21, 0.2);
}

.btn-primary:active:not(:disabled) {
    background-color: var(--stark-black-active);
    transform: scale(0.98);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 17, 21, 0.2);
}

/* Secondary White Pill Button */
.btn-secondary {
    background-color: #FFFFFF;
    color: var(--text-main);
    border-color: var(--border-default);
    box-shadow: var(--shadow-pill);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-card-subtle);
    border-color: var(--border-strong);
    color: var(--text-main);
    transform: translateY(-1px);
}

/* Pastel Mint Button */
.btn-mint {
    background-color: var(--pastel-mint);
    color: var(--pastel-mint-text);
    border-color: var(--pastel-mint-border);
    font-weight: 600;
}

.btn-mint:hover:not(:disabled) {
    background-color: var(--pastel-mint-hover);
    transform: translateY(-1px);
}

/* Danger Crimson Pill Button */
.btn-danger {
    background-color: var(--danger-light);
    color: var(--danger-text);
    border-color: var(--danger-border);
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--danger);
    color: #FFFFFF;
    border-color: var(--danger);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 14px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Copy Pill Button */
.btn-copy {
    background: #FFFFFF;
    border: 1px solid var(--border-default);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 140ms ease;
}

.btn-copy:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.btn-copy.copied {
    background: var(--pastel-mint);
    color: var(--pastel-mint-text);
    border-color: var(--pastel-mint-border);
    font-weight: 600;
}

/* Table Row Action Buttons */
.btn-edit,
.btn-release,
.btn-table-link {
    font-size: 11.5px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    text-decoration: none;
    display: inline-flex;
    align-items: gap;
    gap: 4px;
    cursor: pointer;
    transition: all 140ms ease;
    border: 1px solid transparent;
}

.btn-edit {
    background: #FFFFFF;
    border-color: var(--border-default);
    color: var(--text-main);
}

.btn-edit:hover {
    background: var(--bg-card-subtle);
    border-color: var(--stark-black);
    transform: translateY(-1px);
}

.btn-release {
    background: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.btn-release:hover {
    background: var(--danger);
    color: #FFFFFF;
    border-color: var(--danger);
}

.btn-table-link {
    background: #FFFFFF;
    border-color: var(--border-default);
    color: var(--stark-black);
}

.btn-table-link:hover {
    background: var(--pastel-mint);
    color: var(--pastel-mint-text);
    border-color: var(--pastel-mint-border);
}

/* ==========================================================================
   Data Tables (High Density, High Legibility)
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

.data-table td {
    padding: 11px 20px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-body);
}

.data-table tbody tr {
    transition: background-color 100ms ease;
}

.data-table tbody tr:hover {
    background-color: #F8FAFC;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Badges (Strictly Pill-Shaped 9999px)
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
}

.badge-cidr {
    background-color: var(--pastel-mint);
    color: var(--pastel-mint-text);
    border: 1px solid var(--pastel-mint-border);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    font-family: var(--font-mono);
}

.badge-vlan {
    background-color: var(--pastel-cyan);
    color: var(--pastel-cyan-text);
    border: 1px solid var(--pastel-cyan-border);
    font-size: 11.5px;
    font-family: var(--font-mono);
}

.badge-subtext {
    font-weight: 500;
    color: var(--text-muted);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info-text);
    border: 1px solid var(--info-border);
}

.badge-neutral {
    background-color: var(--bg-card-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-default);
}

/* ==========================================================================
   Search Input (Pill Shaped)
   ========================================================================== */
.table-search-box {
    min-width: 270px;
    position: relative;
}

.search-input {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 8px 18px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    background-color: #FFFFFF;
    color: var(--text-main);
    outline: none;
    transition: all 160ms ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.search-input:focus {
    border-color: var(--stark-black);
    box-shadow: 0 0 0 3px rgba(15, 17, 21, 0.1);
}

/* ==========================================================================
   Modals (20px - 24px Border Radius)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-20);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.modal-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 520px;
    border: 1px solid var(--border-default);
    transform: translateY(10px) scale(0.98);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-backdrop.is-active .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-20) var(--space-24);
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.modal-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-close-btn {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 140ms;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.modal-body {
    padding: var(--space-24);
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-12);
    padding: var(--space-16) var(--space-24);
    border-top: 1px solid var(--border-light);
    background: #FFFFFF;
}

/* Form Groups & Inputs */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: var(--space-6);
}

.required-asterisk {
    color: var(--danger);
}

.optional-tag {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11.5px;
}

.form-control {
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 9px 16px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    background-color: #FFFFFF;
    color: var(--text-main);
    outline: none;
    transition: all 160ms ease;
    width: 100%;
}

textarea.form-control {
    border-radius: var(--radius-md);
    min-height: 80px;
    resize: vertical;
}

.form-control:focus {
    border-color: var(--stark-black);
    box-shadow: 0 0 0 3px rgba(15, 17, 21, 0.1);
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: var(--space-6);
    line-height: 16px;
}

/* ==========================================================================
   Alerts & Feedback
   ========================================================================== */
.alert {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    padding: var(--space-12) var(--space-18);
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: var(--space-20);
    line-height: 20px;
}

.alert-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alert-success {
    background-color: var(--success-light);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.alert-danger {
    background-color: var(--danger-light);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

/* Empty State */
.empty-state {
    padding: var(--space-48) var(--space-24);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.empty-icon-wrap {
    width: 52px;
    height: 52px;
    margin: 0 auto var(--space-16);
    background: var(--pastel-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pastel-cyan-text);
}

.empty-icon {
    width: 26px;
    height: 26px;
}

.empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: var(--space-6);
}

.empty-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 20px;
}

/* ==========================================================================
   Subnet Space Map Grid Matrix (Pastel Mint Panel & Stark Black Blocks)
   ========================================================================== */
.space-map-controls {
    display: flex;
    align-items: center;
    gap: var(--space-16);
    flex-wrap: wrap;
}

.block-selector {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.block-select-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.space-legend {
    display: flex;
    align-items: center;
    gap: var(--space-14);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    font-size: 12px;
    color: var(--text-muted);
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.legend-free {
    background: #FFFFFF;
    border: 1px solid var(--border-default);
}

.legend-used {
    background: var(--stark-black);
    border: 1px solid var(--stark-black);
}

.legend-reserved {
    background: #E2E8F0;
}

.space-map-grid {
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: var(--space-16);
}

.space-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
    padding: 0;
    user-select: none;
}

.space-cell-free {
    background: #FFFFFF;
    border-color: var(--border-default);
    color: var(--text-muted);
}

.space-cell-free:hover {
    background: var(--pastel-mint);
    border-color: var(--stark-black);
    color: var(--pastel-mint-text);
    transform: scale(1.15);
    z-index: 2;
    box-shadow: var(--shadow-card);
}

.space-cell-used {
    background: var(--stark-black);
    border-color: var(--stark-black);
    color: #FFFFFF;
    font-weight: 600;
}

.space-cell-used:hover {
    background: var(--stark-black-hover);
    transform: scale(1.18);
    z-index: 2;
    box-shadow: 0 4px 10px rgba(15, 17, 21, 0.25);
}

.space-cell-network,
.space-cell-broadcast {
    background: #E2E8F0;
    border-color: var(--border-default);
    color: var(--text-subtle);
    cursor: not-allowed;
    opacity: 0.85;
}

.cell-octet {
    pointer-events: none;
}

.space-map-hover-bar {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    padding: 10px 16px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: 12px;
    min-height: 40px;
    flex-wrap: wrap;
}

.hover-label {
    font-weight: 600;
    color: var(--text-muted);
}

.hover-value {
    font-weight: 600;
    color: var(--text-main);
}

.hover-meta {
    color: var(--text-muted);
    margin-left: auto;
}

/* ==========================================================================
   Modules Grid (Dashboard)
   ========================================================================== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-16);
}

.module-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-20);
    background: #FFFFFF;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-main);
    transition: all 180ms ease;
}

.module-card:not(.disabled):hover {
    background: #FFFFFF;
    border-color: var(--stark-black);
    transform: translateY(-2px);
    box-shadow: var(--shadow-floating);
}

.module-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.module-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-6);
    color: var(--text-main);
}

.module-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 18px;
    flex: 1;
}

.module-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--stark-black);
    margin-top: var(--space-14);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.module-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    margin-top: var(--space-14);
    font-family: var(--font-mono);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    padding: var(--space-16) var(--space-24) var(--space-20) var(--space-24);
    margin-top: auto;
}

.footer-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-12);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-size: 12px;
    color: var(--text-muted);
}

.footer-brand-title {
    font-weight: 600;
    color: var(--text-main);
}

.footer-version-tag {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-default);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.floating-dock-pill {
    background-color: #FFFFFF;
    color: var(--text-main);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-12);
    font-size: 11.5px;
    font-family: var(--font-mono);
    box-shadow: var(--shadow-pill);
}

.dock-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
    flex-shrink: 0;
}

.dock-divider {
    width: 1px;
    height: 12px;
    background-color: var(--border-default);
}

.dock-meta-item strong {
    color: var(--text-main);
    font-weight: 600;
}

/* ==========================================================================
   Navigation Progress Bar & Loading States
   ========================================================================== */
.nav-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #10B981, #0284C7);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    z-index: 9999;
    transition: width 200ms ease, opacity 160ms ease;
    opacity: 0;
    pointer-events: none;
}

.nav-progress-bar.active {
    width: 75%;
    opacity: 1;
}

.nav-progress-bar.done {
    width: 100%;
    opacity: 0;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Typography & Utility Classes
   ========================================================================== */
.font-mono { font-family: var(--font-mono); }
.font-mono-sub { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.text-mono-sm { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.italic { font-style: italic; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-16 { margin-top: var(--space-16); }
.mt-24 { margin-top: var(--space-24); }
.mb-24 { margin-bottom: var(--space-24); }
.ml-8 { margin-left: var(--space-8); }
.font-bold { font-weight: 700; }
.text-success { color: var(--success); }
.hidden { display: none !important; }

.table-actions-group {
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

.actions-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    justify-content: flex-end;
}

.link-badge {
    text-decoration: none;
    transition: transform 120ms ease;
    cursor: pointer;
}

.link-badge:hover {
    transform: translateY(-1px);
}

.device-cell-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.row-highlight {
    background-color: var(--pastel-mint) !important;
    transition: background-color 200ms ease;
}

/* Error View Styles */
.error-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-32);
    text-align: center;
    max-width: 520px;
    margin: var(--space-32) auto;
    box-shadow: var(--shadow-card);
}

.error-badge {
    display: inline-block;
    background: var(--danger-light);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: var(--space-16);
}

.error-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: var(--space-8);
}

.error-message {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: var(--space-24);
    line-height: 22px;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-12);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
    .space-map-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 1250px) {
    .header-trio-bar,
    .app-header {
        display: flex;
        justify-content: space-between;
        gap: var(--space-12);
    }

    .header-brand-card {
        padding: 0 14px 0 10px;
        gap: var(--space-6);
    }

    .header-nav-card {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .header-nav-card::-webkit-scrollbar {
        display: none;
    }

    .header-user-card,
    .header-telemetry-card {
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    .app-frame {
        padding: 0;
    }

    .app-canvas {
        border-radius: 0;
        border: none;
        min-height: 100vh;
    }

    .header-trio-bar,
    .app-header {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-8);
        position: static;
        margin: var(--space-8) var(--space-8) var(--space-12) var(--space-8);
        width: calc(100% - 16px);
    }

    .header-brand-card {
        flex: 1;
        justify-content: flex-start;
        height: 52px;
        min-height: 52px;
        padding: 0 12px 0 8px;
    }

    .header-user-card,
    .header-telemetry-card {
        flex-shrink: 0;
        height: 52px;
        min-height: 52px;
        padding: 0 8px;
        gap: 6px;
    }

    .header-icon-btn,
    .header-profile-btn {
        width: 34px;
        height: 34px;
    }

    .notif-dropdown {
        width: 290px;
        right: -30px;
    }

    .profile-dropdown {
        width: 250px;
    }

    .nav-folder-tab-bridge {
        display: none !important;
    }

    .floating-pill-list,
    .nav-list {
        gap: var(--space-6);
        padding: 2px;
    }

    .header-nav-card {
        width: 100%;
        order: 3;
        height: 52px;
        min-height: 52px;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 0 8px;
        justify-content: flex-start;
    }

    .header-nav-card .nav-pill {
        height: 36px;
        padding: 6px 12px;
    }

    .page-body {
        padding: var(--space-16);
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
    }

    .card-header.flex-between {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search-box {
        width: 100%;
    }

    .table-actions-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .space-map-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .space-map-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Topology Canvas & Dynamic Graph Engine (vis-network)
   ========================================================================== */
.topology-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--space-24);
    align-items: start;
}

@media (max-width: 1024px) {
    .topology-grid {
        grid-template-columns: 1fr;
    }
}

.topology-canvas-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.topology-viewport-wrap {
    position: relative;
    width: 100%;
    height: 640px;
    background-color: #FAFCFF;
    background-image: radial-gradient(#E2E8F0 1.2px, transparent 1.2px);
    background-size: 24px 24px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.topology-canvas-viewport {
    width: 100%;
    height: 100%;
    outline: none;
}

/* Floating Controls Toolbar inside Canvas */
.topology-floating-controls {
    position: absolute;
    top: var(--space-16);
    left: var(--space-16);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: var(--space-8);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-default);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.topology-ctrl-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: #FFFFFF;
    border: 1px solid var(--border-default);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 140ms ease;
}

.topology-ctrl-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--stark-black);
    color: var(--stark-black);
    transform: translateY(-1px);
}

.topology-ctrl-btn.active {
    background: var(--stark-black);
    color: #FFFFFF;
    border-color: var(--stark-black);
}

.topology-ctrl-divider {
    width: 1px;
    height: 18px;
    background: var(--border-default);
}

.topology-filter-input {
    border: 1px solid var(--border-default);
    background: #FFFFFF;
    border-radius: var(--radius-full);
    padding: 5px 12px;
    font-size: 12px;
    font-family: var(--font-sans);
    color: var(--text-main);
    width: 160px;
    outline: none;
    transition: all 160ms ease;
}

.topology-filter-input:focus {
    border-color: var(--stark-black);
    box-shadow: 0 0 0 2px rgba(15, 17, 21, 0.08);
    width: 200px;
}

/* Canvas Legend Overlay */
.topology-legend-overlay {
    position: absolute;
    bottom: var(--space-16);
    left: var(--space-16);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: var(--space-8);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-default);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    font-size: 11.5px;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-swatch-device {
    background: #0F1115;
    border: 1px solid #22252A;
}

.legend-swatch-subnet {
    background: #D4F0EB;
    border: 1px solid #BFE5DD;
}

.legend-swatch-link {
    width: 14px;
    height: 2px;
    background: #94A3B8;
    border-radius: 1px;
}

/* Loading Overlay */
.topology-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-12);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: opacity 200ms ease, visibility 200ms ease;
}

.topology-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.topology-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-default);
    border-top-color: var(--stark-black);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

/* Inspector Panel */
.topology-inspector-card {
    background: #FFFFFF;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    position: sticky;
    top: calc(var(--space-16) + 70px);
}

.inspector-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-8) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12.5px;
}

.inspector-meta-row:last-child {
    border-bottom: none;
}

.inspector-meta-label {
    color: var(--text-muted);
    font-weight: 500;
}

.inspector-meta-value {
    color: var(--text-main);
    font-weight: 600;
    text-align: right;
}

.inspector-meta-value.mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

.inspector-link-list {
    margin-top: var(--space-12);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    max-height: 220px;
    overflow-y: auto;
}

.inspector-link-item {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

