@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-variable.woff2") format("woff2");
}

:root {
  /* portal.adepts.in palette (light) */
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0d9488;       /* teal */
  --accent-2: #0f766e;     /* darker teal */
  --accent-soft: #f0fdfa;  /* active nav bg */
  --navy: #113257;
  --ok: #10b981;           /* emerald */
  --warn: #f59e0b;         /* amber */
  --danger: #dc2626;       /* red */
  --info: #0ea5e9;         /* sky */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -14px rgba(15,23,42,.18);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 56px;
  --sidebar-w: 224px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }

/* ---- top header ---- */
.topheader {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.hamburger { display: none; background: none; border: none; color: var(--text);
  cursor: pointer; padding: .25rem; margin-right: .15rem; }
.hamburger svg { width: 24px; height: 24px; display: block; }
.nav-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15,23,42,.45); }
.brandwrap { display: flex; align-items: center; gap: .6rem; }
.wordmark { height: 20px; width: auto; display: block; }
.app-tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: .15rem .5rem; border-radius: 999px;
}
.topright { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.welcome { font-size: 13px; color: var(--muted); }
.welcome-name { font-weight: 700; color: var(--accent); }
.avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: .8rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.avatar:hover { text-decoration: none; }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: 46px; min-width: 180px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: .35rem; z-index: 40;
}
.menu-pop a { display: block; padding: .5rem .6rem; border-radius: 7px; color: var(--text); font-size: .9rem; }
.menu-pop a:hover { background: var(--panel-2); text-decoration: none; }

.cachebtn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: none; border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; padding: .35rem .6rem; border-radius: 8px; font-size: 13px;
}
.cachebtn:hover { background: var(--panel-2); color: var(--text); border-color: var(--accent); }
.cachebtn svg { width: 16px; height: 16px; }
.cachebtn[disabled] { opacity: .65; cursor: default; }
.cachebtn svg.spinning { animation: foundry-spin .8s linear infinite; }
@keyframes foundry-spin { to { transform: rotate(360deg); } }
/* prominent header CTA — start a new deployment */
.hdr-cta {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: .42rem .8rem; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.hdr-cta:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; text-decoration: none; }
.hdr-cta svg { width: 15px; height: 15px; }

/* ---- shell: sidebar + content ---- */
.shell { display: flex; align-items: stretch; }
body.app { display: flex; flex-direction: column; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--panel); border-right: 1px solid var(--border);
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto; display: flex; flex-direction: column;
  padding: .85rem .7rem;
}
.sidebar-search { position: relative; margin-bottom: .85rem; }
.sidebar-search input {
  width: 100%; padding: .5rem .7rem .5rem 2rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: .88rem;
}
.sidebar-search input:focus { outline: none; border-color: var(--accent); }
.sidebar-search svg { position: absolute; left: .55rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); }

.sidenav { display: flex; flex-direction: column; gap: .1rem; flex: 1; }
.nav-group { margin-top: .9rem; }
.nav-group-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: .2rem .65rem .35rem;
}
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  color: var(--text); padding: .5rem .65rem; border-radius: 8px; font-size: .9rem;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.nav-item:hover { background: var(--panel-2); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.nav-item.active svg { color: var(--accent); }

/* expandable parent (Settings) + its children */
.nav-parent { width: 100%; background: none; border: none; cursor: pointer; font: inherit; text-align: left; }
.nav-item svg.nav-caret { width: 13px; height: 13px; margin-left: auto; transition: transform .15s ease; }
.nav-item svg.nav-caret.open { transform: rotate(90deg); }
.nav-children { display: flex; flex-direction: column; gap: .1rem; margin: .1rem 0 .1rem; }
.nav-child { color: var(--muted); font-size: .86rem; padding: .42rem .65rem .42rem 2.4rem; border-radius: 8px; }
.nav-child:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-child.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }

.sidebar-foot {
  border-top: 1px solid var(--border); margin-top: .6rem; padding-top: .6rem;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-foot .ver { font-size: .72rem; color: var(--muted); }
.collapse-btn {
  background: none; border: none; color: var(--muted); cursor: pointer; padding: .3rem;
  border-radius: 7px; display: inline-flex;
}
.collapse-btn:hover { background: var(--panel-2); color: var(--text); }
.collapse-btn svg { width: 18px; height: 18px; }

/* collapsed icon-rail (desktop only — on mobile the sidebar is a drawer) */
@media (min-width: 821px) {
  body.collapsed .sidebar { width: 60px; padding: .85rem .5rem; }
  body.collapsed .sidebar-search,
  body.collapsed .nav-group-label,
  body.collapsed .nav-item span,
  body.collapsed .nav-caret,
  body.collapsed .nav-children,
  body.collapsed .sidebar-foot .ver { display: none; }
  body.collapsed .nav-item { justify-content: center; padding: .55rem; }
  body.collapsed .sidebar-foot { justify-content: center; }
}

/* ---- content ---- */
.content { flex: 1; min-width: 0; padding: 1.25rem 1.5rem; }
main.centered {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .5rem; padding: 1.5rem;
}
main.centered .flashes { width: 100%; max-width: 380px; }

/* One standard page container. .narrow is the form/focused variant. */
.page { max-width: 1440px; margin: 0 auto; }
.page.narrow { max-width: 640px; }
.page > :first-child { margin-top: 0; }   /* no redundant gap above the first block */
.page h1 { margin: 0 0 .25rem; letter-spacing: -.02em; font-size: 1.5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; gap: 1rem; }
.page-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-bottom: .25rem; }

/* first card in a page (or in a leading form) sits flush — no redundant top gap */
.page > .card:first-child,
.page > form:first-child > .card:first-child { margin-top: 0; }

/* ---- cards ---- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-top: 1rem;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card h2 { margin: 0 0 .5rem; font-size: 1.02rem; }
.placeholder { border-style: dashed; box-shadow: none; }
.problem-list { margin: .5rem 0; padding-left: 1.2rem; }
.problem-list li { margin: .3rem 0; }

/* ---- addon library: Apps / Industries / Themes ---- */
/* one cohesive filter toolbar: category + version dropdowns left, actions right */
.libbar { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1rem;
  padding-bottom: .9rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--border); }
.libbar-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.libbar-actions { display: flex; gap: .5rem; flex-shrink: 0; margin-left: auto; }
/* .input.filter-select beats the generic .input { width:100% } that comes later in the file */
.input.filter-select { width: auto; min-width: 170px; max-width: 240px;
  padding-top: .4rem; padding-bottom: .4rem; cursor: pointer; }
/* static chip used on the addon detail page */
.pill { display: inline-flex; align-items: center; padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); font-size: .82rem; background: var(--panel); }
.cat-section { margin-top: 1.25rem; }
.cat-head { font-size: 1.02rem; margin: 0 0 .6rem; }
.addon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.addon-card { display: flex; flex-direction: column; gap: .35rem; padding: .9rem; min-height: 120px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text); transition: border-color .12s, transform .12s; }
.addon-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.addon-card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.addon-name { font-weight: 600; font-size: .95rem; line-height: 1.25; }
.addon-tech { word-break: break-all; }
.addon-foot { margin-top: auto; }
@media (max-width: 560px) {
  .libbar-actions { margin-left: 0; width: 100%; }
  .libbar-actions .btn { flex: 1; text-align: center; }
}
/* small industry tags on cards + detail */
.taglist { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { display: inline-flex; align-items: center; padding: .12rem .5rem; border-radius: 6px;
  font-size: .72rem; font-weight: 600; background: var(--accent-soft); color: var(--accent-2); }
/* required Industries checkbox group on the ingest forms */
.checkrow { list-style: none; padding: 0; margin: .3rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem .6rem; }
.checkrow li { margin: 0; }
.checkrow label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; cursor: pointer;
  padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem;
  color: var(--text); font-weight: 500; }
.checkrow input { accent-color: var(--accent); }
.checkrow label:hover { background: var(--panel-2); }
/* addon/theme picker in the new-deployment form */
.addon-pick { display: flex; flex-direction: column; gap: .15rem; max-height: 300px; overflow: auto;
  border: 1px solid var(--border); border-radius: 8px; padding: .35rem; margin-top: .3rem; }
.addon-pick-row { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .35rem .45rem;
  border-radius: 6px; cursor: pointer; font-weight: 400; }
.addon-pick-row:hover { background: var(--panel-2); }
.addon-pick-row input { accent-color: var(--accent); }
.addon-pick-name { flex: 1; font-size: .9rem; }

/* ---- server readiness panel ---- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 1rem; margin: .25rem 0 1rem; }
.facts > div { display: flex; flex-direction: column; gap: .1rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.facts .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.facts .v { font-size: .92rem; color: var(--text); }
.series-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 1rem; }
.series-pill { display: inline-flex; align-items: center; padding: .3rem .7rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600; border: 1px solid transparent; }
.series-ok { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent); }
.series-fail { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.checks { display: flex; flex-direction: column; }
.check { display: grid; grid-template-columns: 12px 116px 1fr; align-items: baseline; gap: .55rem;
  padding: .4rem .1rem; border-bottom: 1px solid var(--border); }
.check:last-child { border-bottom: none; }
.check-dot { width: 9px; height: 9px; border-radius: 999px; align-self: center; }
.check-ok .check-dot { background: var(--ok); }
.check-warn .check-dot { background: var(--warn); }
.check-fail .check-dot { background: var(--danger); }
.check-label { font-weight: 600; font-size: .88rem; }
.check-detail { line-height: 1.35; }
@media (max-width: 560px) {
  .check { grid-template-columns: 12px 1fr; }
  .check-detail { grid-column: 2; }
}

.auth-card { width: 100%; max-width: 380px; }
.auth-head { text-align: center; margin-bottom: 1.25rem; }
.logo { margin: 0; font-size: 2rem; letter-spacing: -.04em; color: var(--navy); }

/* ---- forms ---- */
label { display: block; font-size: .82rem; color: var(--muted); margin: .85rem 0 .3rem; font-weight: 500; }
.input {
  width: 100%; padding: .55rem .7rem;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .92rem;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.code-input { font-family: var(--mono); letter-spacing: .3em; text-align: center; font-size: 1.2rem; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: .8rem; }

.btn {
  display: inline-block; padding: .55rem 1rem; border-radius: 8px;
  border: 1px solid transparent; font-size: .9rem; cursor: pointer; text-align: center;
  font-family: inherit; font-weight: 500;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); text-decoration: none; }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--panel-2); text-decoration: none; }
.btn-block { width: 100%; margin-top: 1.1rem; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.row2 { display: flex; gap: .75rem; align-items: flex-end; }
.hint { text-align: center; margin-top: 1rem; font-size: .82rem; }
.err { color: var(--danger); font-size: .82rem; margin: .3rem 0 0; }

.filter-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.filter-row > div { min-width: 120px; }
.filter-row label { margin-top: 0; }
.linkbtn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .85rem; padding: 0; font-family: inherit; }
.linkbtn:hover { color: var(--text); text-decoration: underline; }
.linkbtn.danger { color: var(--danger); }
.logbox { background: #0b1220; border: 1px solid #1e293b; border-radius: 8px;
  padding: .9rem; max-height: 460px; overflow-y: auto; font-family: var(--mono);
  font-size: .8rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
  color: #cbd5e1; margin: 0; }
.radio { display: flex; gap: .6rem; align-items: flex-start; margin: .6rem 0; cursor: pointer; }
.radio input { margin-top: .3rem; }
.radio span { color: var(--text); }

/* ---- 2FA ---- */
.qr-box { display: flex; justify-content: center; padding: 1rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.manual { margin: 1rem 0; }
.manual summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.secret { display: block; margin-top: .5rem; font-family: var(--mono); word-break: break-all;
  background: var(--panel-2); padding: .5rem; border-radius: 6px; }
.codes { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.codes li { font-family: var(--mono); background: var(--panel-2); padding: .45rem .6rem;
  border-radius: 6px; text-align: center; letter-spacing: .08em; }
.visually-hidden { position: absolute; left: -9999px; }

/* ---- profile ---- */
.profile-head { display: flex; align-items: center; gap: 1.1rem; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 999px; flex-shrink: 0;
  background: var(--navy); color: #fff; font-size: 1.4rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.profile-name { font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.tfa-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: .5rem; }
.tfa-form { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; }
.tfa-form .input { margin-bottom: .4rem; }
.tfa-form .btn { margin-top: .3rem; }
@media (max-width: 620px) { .tfa-actions { grid-template-columns: 1fr; } }

/* ---- stats ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); gap: 1rem; margin-top: 1rem; }
.stat {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem 1.3rem; box-shadow: var(--shadow); overflow: hidden;
}
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); opacity: .85; }
.stat.accent-sky::after { background: var(--info); }
.stat.accent-amber::after { background: var(--warn); }
.stat.accent-emerald::after { background: var(--ok); }
.stat-num { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* ---- table ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .table { min-width: 560px; }   /* scroll on narrow screens, don't cram */
.table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.table .mono { white-space: nowrap; }       /* keep timestamps/ports/IPs on one line */
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--panel-2); }

.badge { font-size: .74rem; padding: .15rem .5rem; border-radius: 999px; font-weight: 500; }
.badge-ok { background: #ecfdf5; color: #047857; }
.badge-error { background: #fef2f2; color: #b91c1c; }
.badge-denied { background: #fffbeb; color: #b45309; }

/* ---- flashes (Toast style) ---- */
.flashes {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  width: 340px;
  max-width: calc(100vw - 3rem);
  margin: 0;
  pointer-events: none;
}
.flash {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 16px -6px rgba(15, 23, 42, 0.12);
  animation: toast-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.flash-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.flash-info, .flash-success { background: var(--accent-soft); border-color: #99f6e4; color: var(--accent-2); }
.flash-msg { flex: 1; min-width: 0; font-size: 0.88rem; line-height: 1.4; padding-top: 1px; }
.flash-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.flash-x { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.2rem; opacity: .5; margin-top: -3px; line-height: 1; padding: 2px; }
.flash-x:hover { opacity: 0.9; }

@keyframes toast-enter {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .flashes {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
  }
}

/* ---- responsive: mobile drawer ---- */
@media (max-width: 820px) {
  .hamburger { display: inline-flex; }
  .welcome { display: none; }
  .cachebtn span { display: none; }   /* icon-only on mobile */
  .cachebtn { padding: .35rem; }
  .hdr-cta span { display: none; }
  .hdr-cta { padding: .42rem; }
  .topheader { gap: .5rem; padding: 0 .9rem; }
  .wordmark { height: 18px; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100dvh; width: 264px; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 6px 0 40px rgba(15,23,42,.22);
  }
  .sidebar.open { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  .content { padding: 1.1rem 1rem; }
  .page-head { flex-direction: column; align-items: stretch; }
  .row2 { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .app-tag { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .topright { gap: .5rem; }
  .card { padding: 1rem; }
}

/* ---- Login Mascot and Footer styles ---- */
.login-mascot {
  width: 96px;
  height: 96px;
  margin-bottom: 0.75rem;
  display: inline-block;
}
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
}
