@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

.vp-ge {
  --blue:#444DF9; --teal:#00C3C4; --violet:#8C2FFC;
  --green:#15803D; --green-bg:#DCFCE7;
  --red:#B91C1C; --red-bg:#FEE2E2;
  --amber:#B45309; --amber-bg:#FEF3C7;
  --ink:#0F172A; --text:#1E293B; --muted:#5A6B82; --soft:#94A3B8;
  --line:#E4E9F2; --line-soft:#EEF2F8;
  --bg:#F7F9FC; --surface:#FFFFFF; --hover:#F8FAFF;
  --r:9px; --mono:"JetBrains Mono","Roboto Mono",ui-monospace,monospace;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.vp-ge h1, .vp-ge h2 { margin: 0; color: var(--ink); letter-spacing: -.02em; }
.vp-ge button { font-family: inherit; cursor: pointer; }
.vp-ge a { color: var(--blue); text-decoration: none; }
.vp-ge a:hover { text-decoration: underline; }
.vp-ge :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.vp-ge svg { width: 15px; height: 15px; display: block; flex-shrink: 0; }
.vp-ge .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.vp-ge .appbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); margin: 0; }
.vp-ge .appbar-in { max-width: none; width: 100%; margin: 0; padding: 13px 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vp-ge .appbar-in > div:first-child { min-width: 0; }
.vp-ge .crumb { font-size: 12.5px; color: var(--soft); }
.vp-ge .crumb a { color: var(--muted); }
.vp-ge .gwtitle { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; min-width: 0; }
.vp-ge .gwtitle h1 { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.vp-ge .gwtitle .id { font-family: var(--mono); font-size: 12px; color: var(--soft); }
.vp-ge .spacer { flex: 1; }
.vp-ge .dirty { display: none; align-items: center; gap: 7px; font-size: 12.5px; color: var(--amber);
  background: var(--amber-bg); padding: 5px 12px; border-radius: 999px; font-weight: 600; }
.vp-ge .dirty.on { display: inline-flex; }

.vp-ge .btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--text);
  transition: border-color .14s, background .14s; text-decoration: none !important; }
.vp-ge .btn:hover { border-color: #C9D3E6; background: #FCFDFF; }
.vp-ge .btn-primary { background: var(--blue); border-color: var(--blue); color: #fff !important; }
.vp-ge .btn-primary:hover { background: #3A42D8; }
.vp-ge .btn-sm { padding: 7px 12px; font-size: 13px; }

.vp-ge .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.vp-ge .chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.vp-ge .chip.ok { background: var(--green-bg); color: var(--green); }
.vp-ge .chip.ok .dot { background: var(--green); }
.vp-ge .chip.off { background: var(--red-bg); color: var(--red); }
.vp-ge .chip.off .dot { background: var(--red); }
.vp-ge .chip.term { background: #F3E8FF; color: #7E22CE; }
.vp-ge .chip.term .dot { background: #9333EA; }
.vp-ge .chip.orig { background: #E0F2FE; color: #0369A1; }
.vp-ge .chip.orig .dot { background: #0284C7; }
.vp-ge .chip.both { background: #EEF0FF; color: var(--blue); }
.vp-ge .chip.both .dot { background: var(--blue); }

.vp-ge .shell { max-width: none; width: 100%; margin: 0; padding: 18px 0 120px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 940px) { .vp-ge .shell { grid-template-columns: 1fr; } .vp-ge .sidenav { position: static !important; } }

.vp-ge .sidenav { position: sticky; top: 78px; }
.vp-ge .navsearch { position: relative; margin-bottom: 12px; }
.vp-ge .navsearch input { width: 100%; padding: 9px 12px 9px 32px; font-family: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); }
.vp-ge .navsearch input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(68,77,249,.10); }
.vp-ge .navsearch svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--soft); }
.vp-ge .navlist { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.vp-ge .navlist a { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 7px;
  font-size: 13.5px; color: var(--muted); text-decoration: none; transition: background .12s, color .12s; }
.vp-ge .navlist a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.vp-ge .navlist a.active { background: #EEF0FF; color: var(--blue); font-weight: 600; }
.vp-ge .navlist a.muted { color: var(--soft); }
.vp-ge .navlist .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--soft);
  background: #EEF2F8; padding: 1px 6px; border-radius: 999px; }
.vp-ge .navlist a.active .n { background: #DFE3FF; color: var(--blue); }
.vp-ge .navlist .off { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--soft);
  background: #EEF2F8; padding: 2px 7px; border-radius: 5px; }
.vp-ge .navfoot { margin-top: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; font-size: 12px; color: var(--muted); }
.vp-ge .navfoot b { color: var(--text); }

.vp-ge .filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.vp-ge .toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.vp-ge .toggle input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.vp-ge .hint { font-size: 12.5px; color: var(--muted); }

.vp-ge .sec { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; margin-bottom: 14px;
  scroll-margin-top: 78px; overflow: visible; }
.vp-ge .sec-head { display: flex; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.vp-ge .sec-head h2 { font-size: 15px; font-weight: 700; }
.vp-ge .sec-head .desc { font-size: 12.5px; color: var(--muted); width: 100%; margin-top: -4px; }
.vp-ge .sec-body { padding: 18px 20px 22px; }
.vp-ge .sec.inert .sec-body { opacity: .5; }
.vp-ge .inert-note { display: flex; gap: 9px; align-items: flex-start; background: #F1F4FA; border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px 14px; font-size: 12.5px; color: var(--muted); margin: 0 20px 16px; }
.vp-ge .inert-note b { color: var(--text); }

.vp-ge .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; align-items: start; }
@media (max-width: 1200px) { .vp-ge .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .vp-ge .grid { grid-template-columns: 1fr; } }
.vp-ge .sub { margin-top: 22px; }
.vp-ge .sub:first-child { margin-top: 0; }
.vp-ge .sub-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--soft);
  padding-bottom: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 9px; }
.vp-ge .sub-title .tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  background: #F3E8FF; color: #7E22CE; letter-spacing: .02em; }
.vp-ge .sub-title .tag.off { background: #EEF2F8; color: var(--soft); }

.vp-ge .danger { border: 1px solid #F1C4C4; background: #FEF7F7; border-radius: 11px; padding: 14px 16px; margin-top: 18px; }
.vp-ge .danger .dt { font-size: 13px; font-weight: 700; color: var(--red); margin-bottom: 5px; }
.vp-ge .danger .dd { font-size: 12.5px; color: #7F1D1D; }

.vp-ge .fld.hide, .vp-ge .sub.hide, .vp-ge .sec.hide { display: none !important; }
.vp-ge .flash { margin: 12px 24px 0; }

/* real Formtastic fields */
.vp-ge li.input { list-style: none; margin: 0; padding: 0; min-width: 0; max-width: 100%; }
.vp-ge li.input > label.label, .vp-ge li.input > label:not(:has(input[type=checkbox])) {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.vp-ge li.input abbr { color: var(--red); text-decoration: none; border: 0; margin-left: 2px; }
.vp-ge li.input input[type=text], .vp-ge li.input input[type=number], .vp-ge li.input input[type=password],
.vp-ge li.input input[type=email], .vp-ge li.input select, .vp-ge li.input textarea {
  width: 100%; padding: 9px 11px; font-family: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: none !important; }
.vp-ge li.input textarea { min-height: 76px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.vp-ge li.input input:focus, .vp-ge li.input select:focus, .vp-ge li.input textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(68,77,249,.10) !important; }
.vp-ge li.input .inline-hints, .vp-ge li.input .help, .vp-ge .vp-ge-help {
  font-size: 11.5px; color: var(--soft); margin-top: 5px; line-height: 1.45; }
.vp-ge li.input .inline-errors { color: var(--red); font-size: 12px; margin-top: 4px; }
.vp-ge .vp-ge-diff { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--blue); }
.vp-ge li.critical input[type=text], .vp-ge li.critical input[type=number], .vp-ge li.critical select,
.vp-ge li.critical .ts-wrapper .ts-control { border-color: #D9C9A8 !important; background: #FFFDF7 !important; }
.vp-ge li.critical > label.label::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--amber); margin-right: 6px; vertical-align: middle; }

.vp-ge li.boolean {
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: #FBFCFE; min-width: 0; box-sizing: border-box;
}
.vp-ge li.boolean > label { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.vp-ge li.boolean input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; margin-top: 1px; flex-shrink: 0; }
.vp-ge li.boolean input[type=hidden] { display: none; }
.vp-ge li.boolean .inline-hints, .vp-ge li.boolean .vp-ge-help, .vp-ge li.boolean .vp-ge-diff { margin-left: 26px; }

.vp-ge .ts-wrapper { width: 100% !important; max-width: 100% !important; }
.vp-ge .ts-wrapper .ts-control { border: 1px solid var(--line) !important; border-radius: var(--r) !important;
  padding: 8px 11px !important; min-height: 40px; background: var(--surface) !important; }
.vp-ge .ts-wrapper.focus .ts-control { border-color: var(--blue) !important; box-shadow: 0 0 0 3px rgba(68,77,249,.10) !important; }
.vp-ge form.formtastic select,
.vp-ge form.formtastic input[type=text],
.vp-ge form.formtastic input[type=number],
.vp-ge form.formtastic textarea { max-width: 100% !important; width: 100% !important; }

body.gateways.edit #vp-dash .vpm,
body.gateways.new #vp-dash .vpm { padding-left: 20px; padding-right: 24px; }
body.gateways.edit #main_content_wrapper,
body.gateways.new #main_content_wrapper,
body.gateways.edit #main_content,
body.gateways.new #main_content,
body.gateways.edit #active_admin_content,
body.gateways.new #active_admin_content {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
}

.vp-ge .savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform .2s ease; }
.vp-ge .savebar.on { transform: none; }
.vp-ge .savebar-in { max-width: none; width: 100%; margin: 0; padding: 13px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vp-ge .savebar .msg { font-size: 13.5px; color: var(--text); }
.vp-ge .savebar .msg b { font-weight: 700; }

.vp-ge-src { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.vp-ge .errors, .vp-ge .semantic-errors { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }

.vp-ge .appbar .dropdown_menu { display: inline-block; }
.vp-ge .appbar .dropdown_menu_button { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text); }
body.gateways.edit #title_bar, body.gateways.new #title_bar,
body.gateways.edit #sidebar, body.gateways.new #sidebar,
body.gateways.edit #footer, body.gateways.new #footer { display: none !important; }
