/* wghub theme: palette and typography taken from zjawa.it (Astra theme).
   Fonts are served locally from /static/fonts (no third-party requests from the admin GUI). */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(/static/fonts/montserrat-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(/static/fonts/montserrat-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/source-sans-3-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/source-sans-3-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* zjawa.it palette */
  --zj-green: #287233;         /* buttons, active nav, links */
  --zj-green-hover: #379237;
  --zj-green-light: #54b435;   /* accents, online */
  --zj-green-bg: #edfbe2;      /* card headers, success flash */
  --zj-green-border: #d5ead8;
  --zj-green-dark: #103610;
  --zj-slate: #2f3b40;         /* body text */
  --zj-navy: #0f172a;          /* headings */
  --zj-gray: #808285;          /* muted text */
  --zj-orange: #f5a623;
  --zj-blue: #0274be;
  --zj-red: #c0392b;
  --zj-red-bg: #fdecea;
  --zj-red-border: #f3b5ae;

  --pico-font-family-sans-serif: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pico-font-family: var(--pico-font-family-sans-serif);
  --pico-font-size: 100%;
  --pico-line-height: 1.5;
  --pico-border-radius: 3px;
  --pico-spacing: .9rem;
  --pico-typography-spacing-vertical: .9rem;
}

:root:not([data-theme=dark]), [data-theme=light] {
  --pico-background-color: #fff;
  --pico-color: var(--zj-slate);
  --pico-h1-color: var(--zj-navy);
  --pico-h2-color: var(--zj-navy);
  --pico-h3-color: var(--zj-navy);
  --pico-h4-color: var(--zj-navy);
  --pico-h5-color: var(--zj-navy);
  --pico-h6-color: var(--zj-navy);
  --pico-muted-color: var(--zj-gray);
  --pico-muted-border-color: var(--zj-green-border);
  --pico-border-color: var(--zj-green-border);

  --pico-primary: var(--zj-green);
  --pico-primary-background: var(--zj-green);
  --pico-primary-border: var(--zj-green);
  --pico-primary-hover: var(--zj-green-hover);
  --pico-primary-hover-background: var(--zj-green-hover);
  --pico-primary-hover-border: var(--zj-green-hover);
  --pico-primary-focus: rgba(84, 180, 53, .35);
  --pico-primary-underline: rgba(40, 114, 51, .35);
  --pico-primary-hover-underline: var(--zj-green-hover);
  --pico-primary-inverse: #fff;

  --pico-secondary: #5d6266;
  --pico-secondary-background: var(--zj-gray);
  --pico-secondary-border: var(--zj-gray);
  --pico-secondary-hover: var(--zj-slate);
  --pico-secondary-hover-background: #6b6f72;
  --pico-secondary-hover-border: #6b6f72;
  --pico-secondary-focus: rgba(128, 130, 133, .3);
  --pico-secondary-underline: rgba(128, 130, 133, .5);
  --pico-secondary-inverse: #fff;

  --pico-contrast: var(--zj-navy);
  --pico-contrast-background: var(--zj-navy);
  --pico-contrast-border: var(--zj-navy);
  --pico-contrast-hover: var(--zj-slate);
  --pico-contrast-hover-background: var(--zj-slate);
  --pico-contrast-hover-border: var(--zj-slate);
  --pico-contrast-focus: rgba(15, 23, 42, .25);
  --pico-contrast-inverse: #fff;

  --pico-card-background-color: #fff;
  --pico-card-border-color: var(--zj-green-border);
  --pico-card-sectioning-background-color: #f6fbf1;
  --pico-card-box-shadow: 0 1px 3px rgba(15, 23, 42, .06);

  --pico-table-border-color: var(--zj-green-border);
  --pico-table-row-stripped-background-color: #f8fbf5;

  --pico-form-element-background-color: #fff;
  --pico-form-element-border-color: #cfd8d1;
  --pico-form-element-color: var(--zj-slate);
  --pico-form-element-placeholder-color: #9ca3af;
  --pico-form-element-active-border-color: var(--zj-green);
  --pico-form-element-focus-color: rgba(84, 180, 53, .35);

  --pico-code-background-color: #eceff3;
  --pico-code-color: var(--zj-slate);
  --pico-mark-background-color: var(--zj-green-bg);
}

::selection { background: var(--zj-green); color: #fff; }

h1, h2, h3, h4, h5, h6 { font-family: "Montserrat", var(--pico-font-family-sans-serif); font-weight: 600; letter-spacing: -.01em; }
h3 { --pico-font-size: 1.45rem; }
h4 { --pico-font-size: 1.2rem; }
h5 { --pico-font-size: 1.05rem; }
a:not([role=button]) { text-decoration-thickness: 1px; }

main.container { max-width: 1200px; }

/* ---- header ---- */
header.site { background: #fff; border-bottom: 1px solid var(--zj-green-border); margin-bottom: 1.5rem; }
header.site nav { padding: .35rem 0; flex-wrap: wrap; row-gap: 0; }
header.site nav ul { margin: 0; }
header.site nav ul.brand-row li { padding-left: 0; }
header.site nav ul.user li:last-child { padding-right: 0; }
header.site nav ul.menu { flex: 1 1 auto; justify-content: center; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none !important; color: var(--zj-navy) !important; }
.brand img { width: 40px; height: 40px; display: block; }
.brand .brand-name { font-family: "Montserrat", var(--pico-font-family-sans-serif); font-weight: 700; font-size: 1.15rem; line-height: 1.1; color: var(--zj-navy); }
.brand .brand-host { display: block; font-size: .8rem; color: var(--zj-gray); font-weight: 400; }
header.site nav ul li a.nav-link { color: var(--zj-slate); text-decoration: none; font-weight: 600; padding: .55rem .7rem; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -.35rem; padding-bottom: .7rem; white-space: nowrap; }
header.site nav ul li a.nav-link:hover { color: var(--zj-green); background: transparent; }
header.site nav ul li a.nav-link.active { color: var(--zj-green); border-bottom-color: var(--zj-green); }
header.site .who { font-size: .9rem; color: var(--zj-gray); white-space: nowrap; }
header.site form { margin: 0; }
header.site button.small { margin: 0; }

/* ---- split rows: title left, controls right, wrap on narrow screens ---- */
.split { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; }
.split .range { display: inline-flex; flex-wrap: wrap; gap: .1rem .3rem; }
a.plain { color: inherit; text-decoration: none; } a.plain:hover { color: var(--zj-green); text-decoration: underline; }
.show-sm { display: none; }

/* ---- footer ---- */
footer.site { border-top: 1px solid var(--zj-green-border); margin-top: 2.5rem; padding: 1rem 0 1.6rem; font-size: .85rem; color: var(--zj-gray); display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; align-items: center; }
footer.site a { color: var(--zj-green); text-decoration: none; font-weight: 600; }
footer.site a:hover { color: var(--zj-green-hover); text-decoration: underline; }

/* ---- badges ---- */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 2px; font-size: .78rem; font-weight: 600; letter-spacing: .01em; color: #fff; white-space: nowrap; }
.badge.online { background: var(--zj-green-hover); } .badge.offline { background: var(--zj-red); }
.badge.pending { background: var(--zj-orange); color: var(--zj-navy); } .badge.disabled { background: var(--zj-gray); }
.badge.idle { background: #e6ebee; color: var(--zj-slate); }
.badge.queued { background: var(--zj-gray); } .badge.running { background: var(--zj-blue); }
.badge.succeeded { background: var(--zj-green-hover); } .badge.failed { background: var(--zj-red); }
.badge.admin { background: var(--zj-green); } .badge.viewer { background: var(--zj-slate); }

/* ---- flashes ---- */
.flash { padding: .6rem 1rem; border-radius: var(--pico-border-radius); margin-bottom: 1rem; border: 1px solid; border-left-width: 4px; }
.flash.success { background: var(--zj-green-bg); border-color: var(--zj-green-border); border-left-color: var(--zj-green); color: var(--zj-green-dark); }
.flash.error { background: var(--zj-red-bg); border-color: var(--zj-red-border); border-left-color: var(--zj-red); color: #7a1f16; }
.flash.info { background: #eaf3fb; border-color: #bcd8ef; border-left-color: var(--zj-blue); color: #0f3b5c; }
.flash.warning { background: #fff6e5; border-color: #f7d9a3; border-left-color: var(--zj-orange); color: #6b4a00; }
.err { color: var(--zj-red); }

/* ---- cards / stats ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card { padding: 1rem 1.1rem; border: 1px solid var(--zj-green-border); border-radius: var(--pico-border-radius); background: #fff; box-shadow: var(--pico-card-box-shadow); border-top: 3px solid var(--zj-green); }
.card .num { font-family: "Montserrat", var(--pico-font-family-sans-serif); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--zj-navy); }
.card .lbl { color: var(--zj-gray); font-size: .85rem; margin-top: .3rem; }
.num.ok { color: var(--zj-green-hover) !important; } .num.bad { color: var(--zj-red) !important; }
.num.warn { color: var(--zj-orange) !important; } .num.off { color: var(--zj-gray) !important; }

article { border: 1px solid var(--zj-green-border); box-shadow: var(--pico-card-box-shadow); }
article > header { border-bottom: 1px solid var(--zj-green-border); font-family: "Montserrat", var(--pico-font-family-sans-serif); font-weight: 600; font-size: .95rem; color: var(--zj-navy); }
article > header .muted { font-family: var(--pico-font-family-sans-serif); font-weight: 400; }

/* ---- tables ---- */
table { font-size: .9rem; }
table.clients th, table.clients td { padding: .55rem .5rem; }
table.clients td .sub { display: inline-block; line-height: 1.25; }
thead th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
thead th a.sort:hover { color: var(--zj-green); }
thead th[aria-sort] a.sort { color: var(--zj-slate); }
thead th .sort-dir { font-size: .7em; }
thead th { font-family: "Montserrat", var(--pico-font-family-sans-serif); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--zj-gray); border-bottom: 2px solid var(--zj-green-border); }
table.nets td { vertical-align: middle; }
table.jobs-legend td { font-size: .9rem; vertical-align: top; }
table.nets td:first-child { width: 1%; }
table.nets td:last-child { width: 1%; text-align: right; }

/* ---- buttons ---- */
button, [role=button], [type=submit] { font-weight: 600; }
.row-actions form { display: inline; }
.row-actions button, button.small, a.small[role=button] { padding: .25rem .6rem; font-size: .8rem; margin: 0 .1rem; width: auto; }

/* ---- misc ---- */
.net-check { margin: -.5rem 0 1rem; font-size: .9rem; } .net-check td { padding: .2rem .5rem; } .net-check small { margin-left: .5rem; }
pre.conf { font-size: .8rem; max-height: 420px; overflow: auto; white-space: pre; }
pre.out { font-size: .8rem; max-height: 600px; overflow: auto; background: var(--zj-navy); color: #e5e9ef; padding: .8rem; border-radius: var(--pico-border-radius); white-space: pre-wrap; }
pre.out.stderr { color: #ffb4a2; }
code.inline { font-size: .85rem; word-break: break-all; }
.mono { font-family: var(--pico-font-family-monospace); font-size: .85rem; }
.muted { color: var(--pico-muted-color); }
.inline-form { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.inline-form > * { margin-bottom: 0; }
.flow-filters { margin: 0 0 1rem; } .flow-filters label { margin: 0; font-size: .85rem; } .flow-filters select { margin: 0; padding: .3rem 2rem .3rem .6rem; font-size: .9rem; height: auto; width: auto; }
table.flows td, table.flows th { font-size: .9rem; }
/* ---- flows: tabs and the SVG visualisations ---- */
.tabs { display: flex; gap: .2rem; border-bottom: 2px solid var(--zj-green-border); margin: 0 0 1rem; }
.tabs a { padding: .4rem 1rem; text-decoration: none; color: var(--zj-gray); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--zj-green); border-bottom-color: var(--zj-green); } .tabs a:hover { color: var(--zj-green-hover); }
.viz-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .6rem; font-size: .9rem; }
.viz-bar .seg a { margin-right: .6rem; text-decoration: none; color: var(--zj-gray); cursor: pointer; } .viz-bar .seg a.active { font-weight: 700; color: var(--zj-green); }
.viz svg { width: 100%; height: auto; display: block; font-family: var(--pico-font-family-sans-serif); }
.sankey-grid { display: grid; grid-template-columns: 235px 1fr 235px; gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .sankey-grid { grid-template-columns: 1fr; } }
.sankey .link { opacity: .55; transition: opacity .15s; } .sankey .link:hover { opacity: .9; }
.sankey.dim .link { opacity: .08; } .sankey.dim .link.hl { opacity: .85; }
.sankey .nl { font-size: 12px; fill: var(--zj-navy); } .sankey .ns { font-size: 10px; fill: var(--zj-gray); } .sankey .axis { font-size: 12px; fill: var(--zj-gray); font-weight: 600; }
.topbox { border: 1px solid var(--zj-green-border); border-radius: var(--pico-border-radius); padding: .5rem .7rem; margin-bottom: .7rem; background: #fff; font-size: .8rem; }
.topbox h6 { margin: 0 0 .4rem; font-size: .8rem; color: var(--zj-navy); } .topbox .row { display: flex; gap: .5rem; align-items: flex-start; }
.topbox svg { width: 48px; height: 48px; flex: 0 0 48px; } .topbox ul { list-style: none; padding: 0; margin: 0; min-width: 0; flex: 1; }
.topbox li { display: flex; gap: .35rem; align-items: baseline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.topbox li i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; position: relative; top: -1px; } .topbox li span { overflow: hidden; text-overflow: ellipsis; } .topbox li b { margin-left: auto; font-weight: 600; color: var(--zj-gray); }
.hubmap .edge { fill: none; stroke-linecap: round; opacity: .7; transition: opacity .15s; } .hubmap .edge:hover { opacity: 1; }
.hubmap.dim .edge { opacity: .07; } .hubmap.dim .edge.hl { opacity: .95; }
.hubmap .edge.flowing { stroke-dasharray: 10 8; animation: flowdash 1.2s linear infinite; } .hubmap .edge.flowing.rev { animation-direction: reverse; }
@keyframes flowdash { to { stroke-dashoffset: -18; } }
.hubmap .node text { font-size: 12px; fill: var(--zj-navy); } .hubmap .node .sub { font-size: 10px; fill: var(--zj-gray); } .hubmap .node circle, .hubmap .node rect { stroke: #fff; stroke-width: 2; }
.hubmap .node.dimmed { opacity: .35; } .hubmap a { cursor: pointer; } .hubmap .legend text { font-size: 11px; fill: var(--zj-gray); }
.hubmap .hubc { fill: var(--zj-navy); } .hubmap .svc { stroke: var(--zj-gray) !important; stroke-width: 1.5 !important; }
.nowrap { white-space: nowrap; }
.net-desc { display: flex; gap: .4rem; align-items: center; flex-wrap: nowrap; margin: 0; }
.net-desc input, .net-add input { margin: 0; padding: .3rem .6rem; font-size: .85rem; height: auto; }
.net-desc input { flex: 1 1 8rem; min-width: 0; }
.net-desc button, .net-add button { margin: 0; white-space: nowrap; flex: 0 0 auto; }
.net-add { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 0; }
.net-add input[name=cidr] { flex: 1 1 14rem; min-width: 0; }
.net-add input[name=description] { flex: 1 1 10rem; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.copybox { display: flex; gap: .5rem; align-items: center; }
.copybox input { margin: 0; font-family: var(--pico-font-family-monospace); font-size: .8rem; }
.copybox button { width: auto; margin: 0; white-space: nowrap; }
.range a { margin-right: .6rem; text-decoration: none; color: var(--zj-gray); font-size: .9rem; } .range a.active { font-weight: 700; color: var(--zj-green); }
details summary { cursor: pointer; }
/* destructive, confirmed-by-typing actions (decommission) */
details.danger-zone { border: 1px solid var(--zj-red-border); border-left: 4px solid var(--zj-red); border-radius: var(--pico-border-radius); padding: .5rem .8rem; background: var(--zj-red-bg); }
details.danger-zone summary { color: #7a1f16; font-weight: 600; }
details.danger-zone button.contrast { --pico-background-color: var(--zj-red); --pico-border-color: var(--zj-red); }
details.danger-zone button.contrast:disabled { opacity: .45; }

/* ---- login ---- */
.login-box { max-width: 440px; margin: 3rem auto; }
.login-box .brand { justify-content: center; margin-bottom: 1rem; }
.login-box .brand img { width: 72px; height: 72px; }
.login-box h2 { text-align: center; }
.login-box .tagline { text-align: center; color: var(--zj-gray); margin-top: -.5rem; }

/* ---- header: brand + user on top, scrollable menu below (phones, portrait tablets) ---- */
@media (max-width: 900px) {
  header.site nav { padding: .3rem 0 0; }
  header.site nav ul.brand-row { order: 1; flex: 1 1 auto; }
  header.site nav ul.user { order: 2; }
  header.site nav ul.menu {
    order: 3; flex: 1 0 100%; justify-content: flex-start; margin-top: .2rem;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  header.site nav ul.menu::-webkit-scrollbar { display: none; }
  header.site nav ul.menu li { padding: 0; }
  header.site nav ul.menu li a.nav-link { display: block; padding: .55rem .7rem .6rem; margin: 0; }
  header.site nav ul.menu li:first-child a.nav-link { padding-left: 0; }
  header.site { margin-bottom: 1rem; }
  header.site .who { display: none; }
  .brand img { width: 34px; height: 34px; }
  .brand .brand-name { font-size: 1.05rem; }
  .brand .brand-host { font-size: .72rem; }
}

/* ---- phones and small tablets ---- */
@media (max-width: 768px) {
  :root { --pico-font-size: 95%; --pico-spacing: .75rem; --pico-block-spacing-horizontal: .85rem; --pico-block-spacing-vertical: .85rem; }
  .hide-sm { display: none !important; }
  .show-sm { display: inline; }
  .show-sm.small-line { display: block; font-size: .78rem; margin-top: .15rem; }

  h3 { --pico-font-size: 1.3rem; } h4 { --pico-font-size: 1.1rem; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
  .card { padding: .7rem .8rem; }
  .card .num { font-size: 1.6rem; }
  .card .lbl { font-size: .8rem; }
  .grid2 { gap: 1rem; }
  article { margin-bottom: 1rem; }
  article > header .muted { display: block; font-size: .85rem; }

  table { font-size: .85rem; }
  th, td { padding: .5rem .45rem; }
  article table td { overflow-wrap: anywhere; }
  .grid2 article table td:first-child { width: 36%; }
  thead th { font-size: .7rem; letter-spacing: .02em; }

  .row-actions button, button.small, a.small[role=button] { padding: .4rem .7rem; font-size: .82rem; }
  .copybox { flex-wrap: nowrap; } .copybox input { flex: 1 1 auto; min-width: 0; }
  .inline-form select, .inline-form input { max-width: 100% !important; }
  .net-add input[name=cidr], .net-add input[name=description] { flex-basis: 100%; }
  pre.conf, pre.out { font-size: .72rem; }
  .login-box { margin: 1rem auto; }
  footer.site { flex-direction: column; align-items: flex-start; gap: .3rem; font-size: .8rem; }
}
@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .split > .row-actions, .split > span:last-child { flex-basis: 100%; }
}
