/* ==========================================================================
   FlowSense — AxiCore-inspired dark control interface
   Accent palette: FlowSense blue (#18a2da) + FlowSense green (#96b93c)
   ========================================================================== */

:root {
    --fs-blue: #18a2da;
    --fs-blue-soft: #38d6f5;
    --fs-blue-deep: #0f7fb3;
    --fs-green: #96b93c;
    --fs-green-soft: #c9e35c;
    --fs-green-deep: #6f8f22;
    --fs-bg: #05080d;
    --fs-panel: #0a1119;
    --fs-line: rgba(122, 160, 185, 0.10);
    --fs-text: #e7eef5;
    --fs-muted: #8ea1b3;
    --fs-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --fs-display: 'Space Grotesk', 'Outfit', sans-serif;
}

html {
    color-scheme: dark;
}

body.fs-body {
    font-family: 'Inter', sans-serif;
    background-color: var(--fs-bg);
    background-image:
        radial-gradient(1000px 560px at 88% -12%, rgba(24, 162, 218, 0.11), transparent 62%),
        radial-gradient(820px 460px at -8% 104%, rgba(150, 185, 60, 0.08), transparent 62%),
        linear-gradient(180deg, #05080d 0%, #05080d 58%, #03060a 100%);
    background-attachment: fixed;
    letter-spacing: -0.01em;
}

::selection {
    background: rgba(24, 162, 218, 0.35);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.fs-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 64px;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 18px;
    background: rgba(6, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(122, 160, 185, 0.10);
}

.fs-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.fs-brand-logo {
    display: block;
    height: 30px;
    width: auto;
    max-width: min(48vw, 190px);
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(24, 162, 218, 0.18));
}

.fs-topbar-sep {
    width: 1px;
    height: 24px;
    background: rgba(122, 160, 185, 0.18);
    flex: none;
}

.fs-topbar-caption {
    font-family: var(--fs-mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #7c90a3;
    white-space: nowrap;
}

.fs-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid rgba(150, 185, 60, 0.35);
    background: rgba(150, 185, 60, 0.08);
    color: #c4e26e;
    font-family: var(--fs-mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: inset 0 0 18px rgba(150, 185, 60, 0.06);
}

.fs-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b4e04d;
    box-shadow: 0 0 0 0 rgba(180, 224, 77, 0.6);
    animation: fsPulse 2.2s infinite;
    flex: none;
}

@keyframes fsPulse {
    0% { box-shadow: 0 0 0 0 rgba(180, 224, 77, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(180, 224, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(180, 224, 77, 0); }
}

.fs-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(122, 160, 185, 0.14);
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--fs-mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9db0c1;
    white-space: nowrap;
}

.fs-count-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: none;
}

.fs-count-pill.green {
    border-color: rgba(150, 185, 60, 0.28);
    color: #b7d86a;
}

.fs-count-pill.green .dot {
    background: #a9d84a;
    box-shadow: 0 0 8px rgba(169, 216, 74, 0.7);
}

.fs-count-pill.blue {
    border-color: rgba(24, 162, 218, 0.3);
    color: #62d3f5;
}

.fs-count-pill.blue .dot {
    background: var(--fs-blue-soft);
    box-shadow: 0 0 8px rgba(56, 214, 245, 0.7);
}

.fs-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid rgba(122, 160, 185, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: #a3b6c7;
    font-size: 12px;
    transition: all 0.18s ease;
    flex: none;
}

.fs-icon-btn:hover {
    color: var(--fs-blue-soft);
    border-color: rgba(24, 162, 218, 0.4);
    background: rgba(24, 162, 218, 0.08);
}

.fs-icon-btn.danger:hover {
    color: #e88a8a;
    border-color: rgba(200, 90, 90, 0.35);
    background: rgba(200, 90, 90, 0.08);
}

.fs-auto {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(122, 160, 185, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: #b9c9d7;
    font-family: var(--fs-mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.fs-auto:hover {
    border-color: rgba(24, 162, 218, 0.35);
}

.fs-auto b {
    color: #e7eef5;
    font-weight: 600;
}

.fs-switch {
    position: relative;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.25s ease;
    flex: none;
}

.fs-switch i {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e7eef5;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-auto.is-on .fs-switch {
    background: linear-gradient(90deg, var(--fs-blue), var(--fs-green));
    box-shadow: 0 0 12px rgba(24, 162, 218, 0.45);
}

.fs-auto.is-on .fs-switch i {
    transform: translateX(16px);
}

.fs-avatar-btn {
    height: 34px;
    min-width: 34px;
    padding: 0 3px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid rgba(122, 160, 185, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: #a3b6c7;
    transition: all 0.18s ease;
}

.fs-avatar-btn:hover {
    border-color: rgba(24, 162, 218, 0.4);
    color: var(--fs-blue-soft);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.fs-sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    width: 256px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(8, 13, 19, 0.985), rgba(4, 8, 12, 0.99));
    border-right: 1px solid rgba(122, 160, 185, 0.09);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-sidebar.is-open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .fs-sidebar {
        transform: none;
    }
}

.fs-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px 20px;
}

.fs-sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.fs-sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.fs-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(24, 162, 218, 0.25);
    border-radius: 10px;
}

.fs-sidebar-label {
    font-family: var(--fs-mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #5f7487;
    padding: 0 10px;
    margin: 16px 0 7px;
}

.fs-sidebar-label:first-child {
    margin-top: 2px;
}

.fs-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fs-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 10px;
    color: #93a6b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.fs-nav-item:hover {
    color: #e7eef5;
    background: rgba(24, 162, 218, 0.07);
}

.fs-nav-item.is-active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(24, 162, 218, 0.18), rgba(24, 162, 218, 0.02));
    box-shadow: inset 0 0 0 1px rgba(24, 162, 218, 0.16);
}

.fs-nav-item.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--fs-blue), var(--fs-green));
}

.fs-nav-icon {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(122, 160, 185, 0.1);
    color: #8499ac;
    font-size: 10.5px;
    flex: none;
    transition: all 0.18s ease;
}

.fs-nav-item:hover .fs-nav-icon {
    color: var(--fs-blue-soft);
    border-color: rgba(24, 162, 218, 0.25);
}

.fs-nav-item.is-active .fs-nav-icon {
    color: var(--fs-blue-soft);
    background: rgba(24, 162, 218, 0.12);
    border-color: rgba(24, 162, 218, 0.3);
}

.fs-nav-item .fs-nav-chevron {
    margin-left: auto;
    font-size: 8px;
    color: #637889;
    transition: transform 0.25s ease;
}

.fs-nav-sub {
    margin: 2px 0 6px 24px;
    padding-left: 13px;
    border-left: 1px solid rgba(122, 160, 185, 0.12);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.fs-nav-sub a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #8296a8;
    transition: all 0.16s ease;
}

.fs-nav-sub a:hover {
    color: #cfe9f6;
    background: rgba(24, 162, 218, 0.06);
}

.fs-nav-sub a.is-active {
    color: #4cc3ec;
    background: rgba(24, 162, 218, 0.08);
}

.fs-nav-sub i {
    width: 13px;
    text-align: center;
    font-size: 9.5px;
    opacity: 0.8;
}

.fs-sidebar-foot {
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(122, 160, 185, 0.08);
    background: rgba(3, 6, 10, 0.6);
}

.fs-sidebar-foot-checks {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--fs-mono);
    font-size: 7.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #71869a;
    margin-bottom: 10px;
}

.fs-sidebar-foot-checks b {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #a9d84a;
    font-weight: 600;
}

.fs-sidebar-foot-checks b::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #a9d84a;
    box-shadow: 0 0 6px rgba(169, 216, 74, 0.8);
}

.fs-sidebar-version {
    text-align: center;
    font-family: var(--fs-mono);
    font-size: 8px;
    letter-spacing: 0.12em;
    color: #5f7487;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
main {
    margin-left: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-top: 6.5rem !important;
    padding-bottom: 7rem !important;
}

@media (min-width: 640px) {
    main {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

@media (min-width: 1024px) {
    main {
        margin-left: 16rem !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        padding-top: 6.5rem !important;
        padding-bottom: 7rem !important;
    }
}

/* --------------------------------------------------------------------------
   Typography / page headings
   -------------------------------------------------------------------------- */
.fs-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--fs-mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #8095a8;
    margin-bottom: 9px;
}

.fs-eyebrow::before {
    content: '';
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, var(--fs-green), transparent);
    flex: none;
}

.fs-page-title {
    font-family: var(--fs-display);
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #f2f7fb;
}

.fs-page-title em {
    font-style: normal;
    background: linear-gradient(92deg, #6fe2fb, var(--fs-blue) 55%, #8fd448);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 20px rgba(24, 162, 218, 0.25));
}

.fs-page-sub {
    margin-top: 8px;
    font-size: 12.5px;
    color: #8ea1b3;
    max-width: 720px;
}

.fs-section-title {
    font-family: var(--fs-display);
    font-size: clamp(17px, 1.5vw, 21px);
    font-weight: 700;
    color: #cfe3ef;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.fs-mini-label {
    font-family: var(--fs-mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #71869a;
}

/* --------------------------------------------------------------------------
   Header info chips
   -------------------------------------------------------------------------- */
.fs-info-chip {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 188px;
    padding: 10px 13px;
    border-radius: 12px;
    border: 1px solid rgba(122, 160, 185, 0.12);
    background: linear-gradient(145deg, rgba(13, 21, 30, 0.95), rgba(7, 11, 17, 0.95));
}

.fs-info-chip-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 11px;
    flex: none;
}

.fs-info-chip-icon.blue {
    color: #57d2f5;
    background: rgba(24, 162, 218, 0.12);
    border: 1px solid rgba(24, 162, 218, 0.25);
}

.fs-info-chip-icon.green {
    color: #c3e05a;
    background: rgba(150, 185, 60, 0.12);
    border: 1px solid rgba(150, 185, 60, 0.25);
}

.fs-info-chip small {
    display: block;
    font-family: var(--fs-mono);
    font-size: 7.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #71869a;
    line-height: 1;
}

.fs-info-chip b {
    display: block;
    font-size: 11.5px;
    color: #dbe7f0;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1;
}

.fs-info-chip em {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-style: normal;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #8fb84a;
    margin-top: 4px;
    line-height: 1;
}

.fs-info-chip em::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #9ec93f;
}

/* --------------------------------------------------------------------------
   Stat cards
   -------------------------------------------------------------------------- */
.fs-stat {
    --tone: var(--fs-blue);
    --tone-soft: var(--fs-blue-soft);
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(122, 160, 185, 0.10);
    padding: 16px 16px 13px;
    background: linear-gradient(150deg, rgba(13, 21, 30, 0.96), rgba(7, 11, 17, 0.98));
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.fs-stat.tone-green {
    --tone: var(--fs-green);
    --tone-soft: var(--fs-green-soft);
}

.fs-stat::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--tone) 34%, var(--tone-soft) 66%, transparent 100%);
    opacity: 0.65;
}

.fs-stat::after {
    content: '';
    position: absolute;
    right: -55px;
    top: -85px;
    width: 205px;
    height: 165px;
    border-radius: 50%;
    background: var(--tone);
    opacity: 0.1;
    filter: blur(42px);
    pointer-events: none;
}

.fs-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(122, 160, 185, 0.22);
    box-shadow: 0 24px 44px -28px rgba(0, 0, 0, 0.95);
}

.fs-stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.fs-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 10.5px;
    color: var(--tone-soft);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(122, 160, 185, 0.14);
    flex: none;
}

.fs-stat-label {
    font-family: var(--fs-mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #93a8ba;
}

.fs-stat-watermark {
    position: absolute;
    right: 10px;
    top: 6px;
    font-size: 32px;
    color: var(--tone);
    opacity: 0.1;
    transform: rotate(-6deg);
    pointer-events: none;
}

.fs-stat-value {
    position: relative;
    z-index: 1;
    margin-top: 15px;
    font-family: var(--fs-display);
    font-size: 33px;
    line-height: 1;
    font-weight: 700;
    color: #f4f8fb;
    letter-spacing: -0.035em;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.fs-stat-unit {
    font-size: 12px;
    font-weight: 600;
    color: #7f95a8;
    letter-spacing: 0;
}

.fs-bar {
    position: relative;
    height: 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.07);
    margin-top: 15px;
    overflow: hidden;
}

.fs-bar > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--tone), var(--tone-soft));
    box-shadow: 0 0 10px var(--tone);
    transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-stat-foot {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 9px;
    font-size: 9px;
    line-height: 1.35;
    color: #71869a;
}

.fs-stat-foot b {
    color: var(--tone-soft);
    font-weight: 600;
    text-align: right;
}

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */
.fs-panel {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(122, 160, 185, 0.10);
    background: linear-gradient(160deg, rgba(11, 18, 26, 0.97), rgba(6, 10, 16, 0.98));
    box-shadow: 0 30px 60px -42px rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.fs-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(122, 160, 185, 0.08);
}

.fs-node-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(122, 160, 185, 0.14);
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--fs-mono);
    font-size: 7.5px;
    letter-spacing: 0.18em;
    color: #7f95a8;
    text-transform: uppercase;
    white-space: nowrap;
}

.fs-node-chip b {
    color: #cfe3ef;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.fs-node-info {
    position: relative;
    padding: 20px;
    border-bottom: 1px solid rgba(122, 160, 185, 0.08);
    background:
        radial-gradient(130% 110% at 0% 0%, rgba(24, 162, 218, 0.14), transparent 58%),
        linear-gradient(160deg, rgba(12, 20, 29, 0.98), rgba(7, 11, 17, 0.98));
}

@media (min-width: 1280px) {
    .fs-node-info {
        border-bottom: 0;
        border-right: 1px solid rgba(122, 160, 185, 0.08);
        padding: 22px 20px;
    }
}

.fs-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(150, 185, 60, 0.3);
    background: rgba(150, 185, 60, 0.08);
    color: #b9db62;
    font-family: var(--fs-mono);
    font-size: 7.5px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
}

.fs-status-pill i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #a9d84a;
    box-shadow: 0 0 7px rgba(169, 216, 74, 0.8);
}

.fs-node-role {
    font-size: 9.5px;
    color: #7f95a8;
    margin-top: 12px;
}

.fs-node-name {
    font-family: var(--fs-display);
    font-size: 22px;
    font-weight: 700;
    color: #f4f8fb;
    line-height: 1.06;
    margin-top: 3px;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.fs-node-id {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    font-family: var(--fs-mono);
    font-size: 8.5px;
    color: #71869a;
}

.fs-node-id i {
    color: var(--fs-blue);
}

.fs-node-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid rgba(122, 160, 185, 0.08);
}

.fs-node-stats b {
    display: block;
    font-size: 10.5px;
    color: #dbe7f0;
    font-weight: 600;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-net-rows {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid rgba(122, 160, 185, 0.08);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.fs-net-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 9.5px;
    color: #899db0;
}

.fs-net-row i {
    width: 14px;
    text-align: center;
    font-size: 9px;
    color: #4cc3ec;
}

.fs-net-row b {
    margin-left: auto;
    font-family: var(--fs-mono);
    font-size: 10px;
    color: #e7eef5;
    font-weight: 600;
}

.fs-node-foot {
    margin-top: 13px;
    font-size: 8.5px;
    color: #657a8d;
    font-style: italic;
}

.fs-node-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* --------------------------------------------------------------------------
   Metric columns + gauges
   -------------------------------------------------------------------------- */
.fs-metric {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 0;
    border-top: 1px solid rgba(122, 160, 185, 0.08);
    min-width: 0;
}

@media (min-width: 1280px) {
    .fs-metric {
        border-top: 0;
        border-left: 1px solid rgba(122, 160, 185, 0.08);
        padding: 18px 20px 0;
    }
}

.fs-metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.fs-code {
    font-family: var(--fs-mono);
    font-size: 7.5px;
    color: #7f95a8;
    border: 1px solid rgba(122, 160, 185, 0.16);
    border-radius: 5px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.02);
    line-height: 1;
}

.fs-gauge-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0 6px;
    min-height: 178px;
}

.fs-gauge-svg {
    width: 122px;
    height: 122px;
    flex: none;
    filter: drop-shadow(0 0 18px rgba(24, 162, 218, 0.10));
}

.fs-gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.065);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 226.2 75.4;
}

.fs-gauge-arc {
    fill: none;
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 226.2 75.4;
    stroke-dashoffset: 226.2;
    transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-gauge-text {
    font-family: var(--fs-display);
    font-size: 25px;
    font-weight: 700;
    fill: #f4f8fb;
    text-anchor: middle;
    dominant-baseline: middle;
    letter-spacing: -0.03em;
}

.fs-spark {
    width: 100%;
    max-width: 230px;
    height: 40px;
    margin-top: 4px;
    overflow: visible;
}

.fs-spark .spark-line {
    fill: none;
    stroke: var(--fs-green);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(150, 185, 60, 0.55));
}

.fs-spark .spark-fill {
    fill: url(#sparkGradient);
    opacity: 0.28;
}

.fs-metric-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 0;
    border-top: 1px solid rgba(122, 160, 185, 0.08);
    font-size: 9px;
    color: #71869a;
    margin-top: auto;
}

.fs-metric-foot b {
    font-family: var(--fs-display);
    font-size: 11px;
    color: #dfeaf2;
    font-weight: 600;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Buttons / form controls
   -------------------------------------------------------------------------- */
.fs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    font-family: var(--fs-mono);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fs-btn i {
    font-size: 9px;
}

.fs-btn-blue {
    background: linear-gradient(135deg, var(--fs-blue), var(--fs-blue-deep));
    color: #ffffff;
    box-shadow: 0 10px 26px -12px rgba(24, 162, 218, 0.85);
}

.fs-btn-blue:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.fs-btn-green {
    background: linear-gradient(135deg, var(--fs-green), var(--fs-green-deep));
    color: #0a1005;
    box-shadow: 0 10px 26px -12px rgba(150, 185, 60, 0.8);
}

.fs-btn-green:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.fs-btn-ghost {
    border: 1px solid rgba(122, 160, 185, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: #b9c9d7;
}

.fs-btn-ghost:hover {
    border-color: rgba(24, 162, 218, 0.4);
    color: #7fdcf5;
}

.fs-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(5, 9, 14, 0.9);
    border: 1px solid rgba(122, 160, 185, 0.16);
    border-radius: 10px;
    padding: 10px 34px 10px 12px;
    font-size: 11px;
    color: #e7eef5;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f95a8' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.fs-select:focus {
    border-color: rgba(24, 162, 218, 0.5);
    box-shadow: 0 0 0 3px rgba(24, 162, 218, 0.1);
}

/* --------------------------------------------------------------------------
   Map / legend
   -------------------------------------------------------------------------- */
.fs-map {
    width: 100%;
    min-height: 460px;
    border-radius: 14px;
    border: 1px solid rgba(122, 160, 185, 0.12);
    overflow: hidden;
    background: #04080d;
}

.fs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 8.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #7f95a8;
}

.fs-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fs-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: none;
}

.fs-legend .dot-live {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.fs-legend .dot-standby {
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

/* Leaflet dark theme tune-up */
.leaflet-container {
    font-family: inherit;
    border-radius: 0.875rem;
    background: #04080d !important;
}

.leaflet-control-attribution {
    background: rgba(4, 8, 13, 0.85) !important;
    color: #8ea1b3 !important;
}

.leaflet-control-attribution a {
    color: #38d6f5 !important;
}

.leaflet-bar {
    border: 1px solid rgba(122, 160, 185, 0.16) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-bar a {
    background: #0a1119 !important;
    color: #cfe3ef !important;
    border-bottom-color: rgba(122, 160, 185, 0.12) !important;
}

.leaflet-bar a:hover {
    background: #0e1a24 !important;
    color: #38d6f5 !important;
}

.leaflet-popup-content-wrapper {
    background: #0a1119 !important;
    color: #e7eef5 !important;
    border: 1px solid rgba(24, 162, 218, 0.25) !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65) !important;
}

.leaflet-popup-tip {
    background: #0a1119 !important;
    border: 1px solid rgba(24, 162, 218, 0.25) !important;
}

.leaflet-popup-close-button {
    color: #64748b !important;
    font-size: 18px !important;
    top: 6px !important;
    right: 6px !important;
}

.leaflet-popup-close-button:hover {
    color: #38d6f5 !important;
}

/* --------------------------------------------------------------------------
   Shared surfaces used across existing pages
   -------------------------------------------------------------------------- */
.glass-panel {
    background: linear-gradient(160deg, rgba(11, 18, 26, 0.94), rgba(6, 10, 16, 0.96));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(122, 160, 185, 0.10) !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-panel:hover {
    border-color: rgba(24, 162, 218, 0.28) !important;
    box-shadow: 0 26px 60px -40px rgba(0, 0, 0, 0.9);
}

.glass-card,
.login-glass {
    background: linear-gradient(160deg, rgba(11, 18, 26, 0.92), rgba(6, 10, 16, 0.95)) !important;
    border: 1px solid rgba(122, 160, 185, 0.12) !important;
}

/* Global scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #05080d;
}

::-webkit-scrollbar-thumb {
    background: #1c2c3a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fs-blue);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fsFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.fs-fade {
    animation: fsFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fs-fade-1 { animation-delay: 0.05s; }
.fs-fade-2 { animation-delay: 0.12s; }
.fs-fade-3 { animation-delay: 0.19s; }
.fs-fade-4 { animation-delay: 0.26s; }

@keyframes fsPingSlow {
    0% { transform: scale(1); opacity: 0.18; }
    70% { opacity: 0.04; }
    100% { transform: scale(1.6); opacity: 0; }
}

.fs-ping {
    animation: fsPingSlow 4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* --------------------------------------------------------------------------
   Responsive table cards (existing behaviour, new palette)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .responsive-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
        background: transparent !important;
    }

    .responsive-table thead {
        display: none !important;
    }

    .responsive-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .responsive-table tr {
        display: block !important;
        width: 100% !important;
        margin-bottom: 2rem !important;
        padding: 1.5rem !important;
        background: linear-gradient(160deg, rgba(11, 18, 26, 0.95), rgba(6, 10, 16, 0.97)) !important;
        backdrop-filter: blur(10px) !important;
        border-radius: 1.5rem !important;
        border: 1px solid rgba(122, 160, 185, 0.10) !important;
        box-shadow: 0 20px 40px -30px rgba(0, 0, 0, 0.9) !important;
    }

    .responsive-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
        padding: 1rem 0 !important;
        border-bottom: 1px solid rgba(122, 160, 185, 0.06) !important;
        width: 100% !important;
        flex-wrap: wrap !important;
    }

    .responsive-table td:last-child {
        border-bottom: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding-top: 1.5rem !important;
        gap: 0.75rem !important;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-family: var(--fs-mono);
        font-size: 9px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: var(--fs-blue) !important;
        text-align: left;
        width: 40%;
        flex-shrink: 0;
    }
}

/* --------------------------------------------------------------------------
   Mobile footer nav
   -------------------------------------------------------------------------- */
.fs-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 65;
    display: flex;
    justify-content: center;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    pointer-events: none;
}

.fs-dock {
    pointer-events: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    max-width: 560px;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(122, 160, 185, 0.14);
    background: linear-gradient(180deg, rgba(10, 17, 25, 0.96), rgba(6, 10, 16, 0.98));
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.fs-dock a {
    min-width: 0;
}

.fs-dock a > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 11px;
    font-family: var(--fs-mono);
    font-size: 7.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8296a8;
    transition: all 0.16s ease;
}

.fs-dock a > span i {
    font-size: 15px;
    line-height: 1;
}

.fs-dock a > span:hover {
    color: #d7e8f2;
    background: rgba(255, 255, 255, 0.03);
}

.fs-dock a > span.is-active {
    color: #58d2f5;
    background: linear-gradient(180deg, rgba(24, 162, 218, 0.18), rgba(24, 162, 218, 0.04));
    box-shadow: inset 0 0 0 1px rgba(24, 162, 218, 0.18);
}

@media (min-width: 1024px) {
    .fs-mobile-nav {
        padding-bottom: 14px;
    }

    .fs-dock {
        max-width: 620px;
        padding: 7px;
    }

    .fs-dock a > span {
        flex-direction: row;
        gap: 8px;
        padding: 9px 12px;
        font-size: 8px;
    }
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
    .fs-topbar {
        height: 58px;
        padding: 0 12px;
        gap: 8px;
    }

    .fs-sidebar {
        top: 58px;
    }

    .fs-brand-logo {
        height: 26px;
        max-width: 44vw;
    }

    .fs-stat-value {
        font-size: 30px;
    }

    .fs-page-title {
        font-size: 24px;
    }

    .fs-gauge-wrap {
        min-height: 165px;
    }

    .fs-gauge-svg {
        width: 116px;
        height: 116px;
    }

    .fs-map {
        min-height: 360px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fs-fade,
    .fs-live-dot,
    .fs-ping {
        animation: none !important;
    }

    .fs-gauge-arc,
    .fs-bar > span {
        transition: none !important;
    }
}

/* Segmented tabs (plant sub-navigation) */
.fs-tabs-wrap {
    width: 100%;
    margin-bottom: 18px;
    overflow-x: auto;
    scrollbar-width: none;
}

.fs-tabs-wrap::-webkit-scrollbar {
    display: none;
}

.fs-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    width: max-content;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(122, 160, 185, 0.12);
    background: rgba(5, 9, 14, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.fs-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--fs-mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8296a8;
    white-space: nowrap;
    transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.fs-tab i {
    font-size: 9px;
    opacity: 0.8;
}

.fs-tab:hover {
    color: #e7eef5;
    background: rgba(255, 255, 255, 0.04);
}

.fs-tab.is-active {
    color: #58d2f5;
    background: linear-gradient(180deg, rgba(24, 162, 218, 0.2), rgba(24, 162, 218, 0.05));
    box-shadow: inset 0 0 0 1px rgba(24, 162, 218, 0.2);
}

.fs-tab-debug {
    color: #0a1005;
    background: linear-gradient(135deg, #96b93c, #6f8f22);
}

.fs-tab-debug:hover {
    color: #0a1005;
    filter: brightness(1.07);
}

/* ==========================================================================
   Application harmony — carries the control-deck language to every page
   ========================================================================== */

main h1:not(.fs-page-title) {
    font-family: var(--fs-display) !important;
    font-size: clamp(1.55rem, 2.3vw, 2rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.025em !important;
    font-weight: 700 !important;
    color: #f2f7fb !important;
    text-transform: uppercase;
}

main h1:not(.fs-page-title)::before {
    content: 'Flowsense Control';
    display: block;
    margin-bottom: 10px;
    font-family: var(--fs-mono);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #7f95a8;
}

main h1:not(.fs-page-title) > span.text-fs-primary,
main h1:not(.fs-page-title) > span.text-fs-secondary {
    background: linear-gradient(92deg, #6fe2fb, #18a2da 55%, #8fd448);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}

main h1:not(.fs-page-title) + p {
    margin-top: 10px !important;
    color: #8ea1b3 !important;
    font-size: 12.5px !important;
    line-height: 1.65 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    max-width: 760px;
}

main h2,
main h3,
main h4 {
    font-family: var(--fs-display);
}

main .glass-panel {
    border-radius: 18px !important;
    border-top-color: rgba(24, 162, 218, 0.26) !important;
    box-shadow: 0 30px 60px -44px rgba(0, 0, 0, 0.95) !important;
}

main a[class*="rounded-3xl"],
main button[class*="rounded-3xl"] {
    border-radius: 12px !important;
}

/* Primary + secondary actions across every page */
main a[class~="bg-fs-primary"][class*="font-"],
main button[class~="bg-fs-primary"][class*="font-"],
main a[class~="bg-fs-secondary"][class*="font-"],
main button[class~="bg-fs-secondary"][class*="font-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    font-family: var(--fs-mono);
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

main a[class~="bg-fs-primary"][class*="font-"],
main button[class~="bg-fs-primary"][class*="font-"] {
    background: linear-gradient(135deg, #18a2da, #0f7fb3) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px -12px rgba(24, 162, 218, 0.85) !important;
}

main a[class~="bg-fs-secondary"][class*="font-"],
main button[class~="bg-fs-secondary"][class*="font-"] {
    background: linear-gradient(135deg, #96b93c, #6f8f22) !important;
    color: #0a1005 !important;
    box-shadow: 0 10px 24px -12px rgba(150, 185, 60, 0.8) !important;
}

main a[class~="bg-fs-primary"][class*="font-"]:hover,
main button[class~="bg-fs-primary"][class*="font-"]:hover,
main a[class~="bg-fs-secondary"][class*="font-"]:hover,
main button[class~="bg-fs-secondary"][class*="font-"]:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
}

main a[class~="bg-fs-surface"][class*="border"],
main button[class~="bg-fs-surface"][class*="border"] {
    border-radius: 10px !important;
    font-family: var(--fs-mono);
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

main a[class~="bg-fs-surface"][class*="border"]:hover,
main button[class~="bg-fs-surface"][class*="border"]:hover {
    border-color: rgba(24, 162, 218, 0.4) !important;
    color: #7fdcf5 !important;
}

@media (max-width: 767px) {
    main .flex.items-center.justify-between.mb-12,
    main .flex.items-center.justify-between.mb-10,
    main .flex.items-center.justify-between.mb-8,
    main .flex.items-center.justify-between.mb-6 {
        flex-wrap: wrap;
        gap: 16px;
    }
}

main a[class*="rounded-[2.5rem]"],
main button[class*="rounded-[2.5rem]"],
main a[class*="rounded-[3rem]"],
main button[class*="rounded-[3rem]"] {
    border-radius: 14px !important;
}

/* Form controls */
main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]),
main select,
main textarea {
    background-color: rgba(5, 9, 14, 0.85) !important;
    border: 1px solid rgba(122, 160, 185, 0.16) !important;
    border-radius: 10px !important;
    color: #e7eef5 !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):focus,
main select:focus,
main textarea:focus {
    border-color: rgba(24, 162, 218, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(24, 162, 218, 0.10) !important;
    outline: none !important;
}

main input::placeholder,
main textarea::placeholder {
    color: #5f7487 !important;
}

main input[type="checkbox"],
main input[type="radio"] {
    accent-color: var(--fs-blue);
}

/* Tables */
main table thead th {
    background-color: rgba(5, 9, 14, 0.55) !important;
    color: #8ea1b3 !important;
    font-family: var(--fs-mono);
    font-size: 8.5px !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(122, 160, 185, 0.10) !important;
}

main table tbody tr {
    border-bottom: 1px solid rgba(122, 160, 185, 0.06) !important;
}

main table tbody tr:hover {
    background-color: rgba(24, 162, 218, 0.035) !important;
}

/* Shared entrance animations used by legacy pages */
.animate-fade-in-up {
    animation: fsFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-fade-in {
    animation: fsFadeUp 0.45s ease both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(22px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Plant tabs: stack vertically on phones instead of scrolling off-screen */
@media (max-width: 639px) {
    .fs-tabs-wrap {
        overflow-x: visible;
    }

    .fs-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        width: 100%;
    }

    .fs-tab {
        width: 100%;
        padding: 11px 12px;
        font-size: 9px;
    }

    .fs-tab i {
        width: 14px;
        text-align: center;
    }
}
