/* Dash console. Layout and palette follow the Back4App dashboard so switching feels familiar. */
@font-face { font-family: "Sora"; src: url("fonts/sora-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courier-prime-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0f1c32;            /* page / cards */
  --bg-main: #10203a;       /* content area next to the sidebar */
  --topbar: #0a152a;
  --side: #112c4d;
  --side-dark: rgba(16, 32, 58, .6);
  --strip: #303338;         /* grey title strip of Cloud Code / Logs / Settings */
  --line: #34506f;
  --line-soft: rgba(52, 80, 111, .55);
  --row-label: #1d293d;
  --row-value: #34506f;
  --text: #f9f9f9;
  --link: #c1e2ff;
  --muted: rgba(204, 204, 204, .75);
  --green: #27ae60;
  --red: #d86448;
  --blue: #208aec;
  --orange: #f2a33a;
  --head: "Sora", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --grid: "Courier Prime", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --topbar-h: 63px;
  --side-w: 280px;
  --strip-h: 63px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.ic { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.hidden { display: none !important; }
::selection { background: rgba(32, 138, 236, .45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(193, 226, 255, .18); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; font-size: 14px; white-space: nowrap; transition: filter .12s, background .12s; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.green { background: var(--green); font-weight: 600; }
.btn.red { background: var(--red); font-weight: 600; }
.btn.outline { border-color: rgba(249, 249, 249, .8); }
.btn.soft { border-color: var(--line); background: rgba(52, 80, 111, .25); }
.btn.dark { background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .12); }
.btn.small { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--link); }
.iconbtn:hover { background: rgba(193, 226, 255, .12); }
.input, select.input { height: 36px; width: 100%; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line); background: rgba(249, 249, 249, .05); outline: none; }
.input:focus { border-color: var(--blue); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--link) 50%), linear-gradient(135deg, var(--link) 50%, transparent 50%);
  background-position: calc(100% - 17px) 15px, calc(100% - 12px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
select.input option { background: var(--bg); }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; margin-bottom: 6px; font-weight: 600; }
label.field > small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 30; display: flex; align-items: center; gap: 20px; padding: 0 60px;
  background: var(--topbar); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.logo { font: 600 26px/1 var(--head); letter-spacing: -.5px; min-width: 112px; }
.logo b { color: var(--green); font-weight: 600; }
.topnav { display: flex; align-items: center; gap: 36px; margin-left: 39px; font-size: 14px; color: #c5d0e0; }
.topnav a { opacity: .95; }
.navbtn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: inherit; font: inherit; padding: 0; }
.navbtn:hover { color: var(--link); }
.topnav a:hover { color: var(--link); }
.userbtn { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 6px; border: 0; background: rgba(193, 226, 255, .1); }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: #b44cd9; display: grid; place-items: center; font: 600 12px var(--head); }
.menu { position: absolute; z-index: 60; min-width: 180px; padding: 6px; border-radius: 8px; background: #16294a; border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.menu button, .menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: 14px; }
.menu button:hover, .menu a:hover { background: rgba(193, 226, 255, .12); }
.menu .danger { color: #ff9c85; }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 0; }

/* ---------- My apps ---------- */
.page { padding: calc(var(--topbar-h) + 93px) 104px 60px; min-height: 100%; background: radial-gradient(520px 300px at 0 var(--topbar-h), rgba(32, 110, 190, .32), transparent 70%) no-repeat; }
h1.title { margin: 0 0 33px; font: 600 35px/1.25 var(--head); position: relative; }
h1.title::after { content: ""; display: block; width: 14px; height: 3px; margin-top: 6px; border-radius: 2px; background: linear-gradient(90deg, #2bb3c0, var(--green)); }
.tabs { display: flex; gap: 22px; margin-bottom: 30px; font-size: 16px; }
.tabs span { padding-bottom: 5px; border-bottom: 2px solid var(--text); line-height: 19px; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.search { position: relative; width: 200px; }
.search svg { position: absolute; left: 12px; top: 9px; opacity: .7; }
.search input { height: 32px; padding-left: 36px; border: 0; }
table.apps { width: 100%; border-collapse: collapse; }
table.apps th { text-align: left; padding: 8px 12px; font: 600 16px/24px var(--body); white-space: nowrap; }
table.apps th.sortable { cursor: pointer; user-select: none; }
table.apps th .sorter { margin-left: 8px; font-size: 12px; letter-spacing: -3px; opacity: .25; }
table.apps th .sorter.on { opacity: .9; }
table.apps td { height: 45px; padding: 0 12px; border-top: 1px solid var(--line-soft); white-space: nowrap; font-size: 14px; }
table.apps td.plan { color: var(--link); }
table.apps td.dimv { color: #ccc; }
table.apps td.usage { font-size: 12px; }
table.apps tbody tr:hover { background: rgba(52, 80, 111, .2); }
table.apps .name { color: var(--text); }
table.apps .name:hover { color: var(--link); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px; border: 0; border-radius: 4px; background: #2d4a6d; font: 13px var(--mono); color: var(--text); }
.chip:hover { background: #38597f; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px rgba(39, 174, 96, .25); }
.dot.off { background: #8794a8; box-shadow: none; }
.dot.bad { background: var(--orange); box-shadow: 0 0 0 2px rgba(242, 163, 58, .25); }
.meter { display: inline-block; width: 70px; height: 5px; margin-right: 8px; border-radius: 3px; background: rgba(193, 226, 255, .15); vertical-align: middle; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--green); }
.meter.warn i { background: var(--orange); }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }
.platform { margin-top: 28px; font-size: 12px; color: var(--muted); }

/* ---------- New app ---------- */
.narrow { max-width: 560px; margin: 0 auto; }
.card { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 8px; padding: 22px 24px; }
.card + .card { margin-top: 20px; }
.card h3 { margin: 0 0 14px; font: 600 16px var(--head); }
details.adv { margin: 4px 0 18px; }
details.adv summary { cursor: pointer; color: var(--link); margin-bottom: 14px; }
.formrow { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

/* ---------- app layout ---------- */
.side { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--side-w); z-index: 20; display: flex; flex-direction: column; background: var(--side); font-family: var(--head); }
.side-head { display: flex; align-items: center; gap: 8px; height: 79px; padding: 0 16px; border: 0; border-bottom: 1px solid rgba(0, 0, 0, .25); background: transparent; width: 100%; text-align: left; }
.side-head b { flex: 1; font: 600 18px var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { flex: 1; overflow-y: auto; }
.side-item { display: flex; align-items: center; gap: 16px; height: 53px; padding: 0 16px; color: var(--link); font-size: 14px; }
.side-item:hover { background: rgba(16, 32, 58, .35); }
.side-item.active { background: var(--side-dark); color: var(--text); font-weight: 700; }
.side-item.open { color: var(--text); font-weight: 700; }
.side-item.open span { text-decoration: underline; text-underline-offset: 3px; }
.side-item .ext { margin-left: auto; opacity: .5; }
.connect-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 7px; border: 1px solid var(--green); border-radius: 4px; color: var(--green); font: 500 12px var(--body); text-decoration: none !important; }
.connect-chip:hover { background: rgba(39, 174, 96, .15); }
.side-subs { background: var(--side-dark); padding: 10px 0 14px; }
.side-subs a { display: flex; align-items: center; gap: 8px; min-height: 39px; padding: 0 16px 0 48px; color: var(--link); font-size: 14px; }
.side-subs a:hover { color: var(--text); }
.side-subs a.active { color: #fff; font-weight: 600; }
.side-subs .addchip { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 6px; border: 1px solid var(--green); border-radius: 4px; background: transparent; color: var(--green); font: 500 12px var(--body); white-space: nowrap; }
.side-subs .addchip:hover { background: rgba(39, 174, 96, .15); }
.class-list { padding: 2px 0 6px; }
.side-subs .class-list a { min-height: 28px; padding: 0 16px 0 60px; font-weight: 400; position: relative; }
.side-subs .class-list a.active { color: var(--text); font-weight: 600; }
.side-subs .class-list a.active::before { content: ""; position: absolute; left: 50px; top: 5px; bottom: 5px; width: 2px; background: var(--text); }
.class-list .cn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-list .cnt { color: var(--muted); font: 12px var(--body); }
.class-list .hint { padding: 4px 16px 4px 60px; color: var(--muted); font: 12px var(--body); }
.side-foot { padding: 12px 16px; border-top: 1px solid rgba(0, 0, 0, .25); font: 12px var(--body); color: var(--muted); }
.main { margin-left: var(--side-w); padding-top: var(--topbar-h); min-height: 100%; background: var(--bg-main); display: flex; flex-direction: column; }
.main.flat { background: var(--bg); }
.content { padding: 64px 80px 60px; }
.content h1.title { margin-bottom: 24px; }
.btn.actions { height: 40px; min-width: 200px; justify-content: space-between; font-weight: 500; }
.strip { display: flex; align-items: center; gap: 10px; min-height: var(--strip-h); padding: 8px 22px; background: var(--strip); position: sticky; top: var(--topbar-h); z-index: 10; }
.strip h2 { margin: 0; font: 600 18px/1.3 var(--head); }
.strip p { margin: 0; color: #ccc; font-size: 14px; }

/* ---------- overview ---------- */
.ov-head { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.ov-head h3 { display: inline; margin: 0 8px 0 0; font: 600 19px var(--head); }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border: 1px solid var(--green); border-radius: 10px; color: #6fdc9e; font-size: 11px; vertical-align: 3px; }
.appid { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; padding-top: 16px; }
.stats label { display: block; margin-bottom: 4px; color: var(--muted); font: 600 11px var(--body); letter-spacing: .6px; text-transform: uppercase; }
.stats div > span { display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.connect { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.connect button { text-align: left; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-main); }
.connect button:hover, .connect button.on { border-color: var(--link); }
.connect b { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font: 600 16px var(--head); }
.connect small { color: var(--muted); font-size: 12px; }
pre.snippet { margin: 14px 0 0; padding: 14px 16px; border-radius: 8px; background: rgba(0, 0, 0, .28); font: 12.5px/1.6 var(--mono); overflow-x: auto; white-space: pre; }
.card.nextcard > h3 { font-size: 20px; margin-bottom: 8px; }
.next { display: flex; gap: 44px; align-items: flex-start; padding: 30px 30px 26px; }
.next .art { width: 110px; height: 84px; flex: none; color: var(--link); opacity: .8; stroke-width: 1; }
.next h4 { margin: 0 0 12px; font: 600 17px var(--head); }
.next p { margin: 0 0 16px; font-size: 14px; }
.next .btn { height: 36px; font-weight: 500; }

/* ---------- settings ---------- */
.settings { width: 100%; max-width: 916px; margin: 0 auto; padding: 34px 24px 70px; }
.fs { margin-bottom: 40px; }
.fs > h3 { margin: 0 0 4px; font: 600 18px var(--body); }
.fs > p { margin: 0 0 14px; }
.fs-row { display: flex; min-height: 68px; border-bottom: 1px solid var(--bg); }
.fs-row:first-of-type { border-radius: 5px 5px 0 0; overflow: hidden; }
.fs-row:last-of-type { border-radius: 0 0 5px 5px; overflow: hidden; border-bottom: 0; }
.fs-row:only-of-type { border-radius: 5px; }
.fs-label { flex: 0 0 55%; display: flex; flex-direction: column; justify-content: center; padding: 10px 18px; background: var(--row-label); }
.fs-label b { font-weight: 700; }
.fs-label small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.fs-value { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 18px; background: var(--row-value); text-align: right; overflow-wrap: anywhere; }
.fs-value input.bare { width: 100%; height: 34px; border: 0; background: transparent; text-align: right; outline: none; }
.fs-value input.bare:focus { background: rgba(0, 0, 0, .15); border-radius: 4px; padding: 0 8px; }
.keyval { flex: 1; min-width: 0; font: 12.5px var(--mono); overflow-wrap: anywhere; user-select: all; }
.envrow { display: flex; gap: 8px; margin-bottom: 8px; }
.envrow .input { background: var(--row-label); }
.envrow .k { flex: 0 0 34%; font-family: var(--mono); font-size: 13px; }
.envrow .v { flex: 1; font-family: var(--mono); font-size: 13px; }
.note { padding: 12px 16px; border-radius: 8px; background: rgba(52, 80, 111, .5); margin-bottom: 18px; }
.note.warn { background: rgba(242, 163, 58, .16); border: 1px solid rgba(242, 163, 58, .5); }

/* ---------- cloud code ---------- */
.cc { display: flex; flex: none; height: calc(100vh - var(--topbar-h) - var(--strip-h)); min-height: 320px; }
.explorer { flex: 0 0 320px; display: flex; flex-direction: column; background: rgba(0, 0, 0, .2); font: 13.5px -apple-system, "Segoe UI", system-ui, sans-serif; }
.explorer-head { display: flex; align-items: center; height: 36px; padding: 0 8px 0 14px; color: rgba(255, 255, 255, .4); font-size: 11.5px; font-weight: 600; letter-spacing: .6px; }
.tree { flex: 1; overflow: auto; padding-bottom: 20px; }
.tree-row { display: flex; align-items: center; gap: 7px; height: 24px; padding-right: 10px; border: 0; background: transparent; width: 100%; text-align: left; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.tree-row:hover { background: rgba(255, 255, 255, .06); }
.tree-row.sel { background: rgba(32, 138, 236, .2); color: var(--blue); }
.tree-row .fi { color: #e3b341; }
.tree-row .chg { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex: none; }
.editor-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.filebar { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px 0 16px; background: rgba(0, 0, 0, .2); font: 13px var(--mono); }
.filebar .dirty { color: var(--orange); }
.editor { flex: 1; min-height: 0; min-width: 0; position: relative; }
.editor.plain { display: flex; }
.gutter { flex: none; min-width: 52px; padding: 12px 10px 12px 12px; overflow: hidden; text-align: right; white-space: pre; color: rgba(193, 226, 255, .35); font: 13px/1.55 var(--mono); user-select: none; }
textarea.code { flex: 1; min-width: 0; padding: 12px 16px 12px 6px; border: 0; outline: none; resize: none; background: transparent; color: #e6edf5; font: 13px/1.55 var(--mono); tab-size: 2; white-space: pre; overflow: auto; }
.cc-intro { margin: 34px auto auto; padding: 24px 40px; max-width: 780px; text-align: center; }
.cc-intro .round { width: 44px; height: 44px; margin: 0 auto 18px; border-radius: 50%; background: #1c3e66; display: grid; place-items: center; color: var(--link); }
.cc-intro h3 { margin: 0 0 22px; font: 600 20px var(--head); }
.cc-intro p { font-size: 15px; }
.cc-intro p { margin: 0 0 18px; }
.cc-intro .hint { color: var(--muted); font-size: 13px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; padding: 8px 12px; color: var(--muted); font: 600 11px var(--body); letter-spacing: .6px; text-transform: uppercase; }
table.list td { padding: 11px 12px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.tag.ok { background: rgba(39, 174, 96, .2); color: #6fdc9e; }
.tag.fail { background: rgba(216, 100, 72, .22); color: #ff9c85; }
.tag.live { background: rgba(32, 138, 236, .25); color: #9fd0ff; margin-left: 8px; }

/* ---------- logs ---------- */
.logs { padding: 16px 22px 60px; }
.logs .entry { margin-bottom: 12px; font: 12.5px/1.5 var(--mono); }
.logs .ts { display: block; color: var(--green); font-size: 11.5px; }
.logs .msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.logs .entry.err .msg { color: #ffb3a1; }

/* ---------- overlay bits ---------- */
.backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(4, 10, 22, .7); }
.modal { width: min(640px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: #13243f; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal.wide { width: min(860px, 100%); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); font: 600 16px var(--head); }
.modal .body { padding: 18px 20px; overflow: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
pre.joblog { margin: 0; padding: 12px 14px; min-height: 120px; max-height: 46vh; overflow: auto; border-radius: 6px; background: rgba(0, 0, 0, .35); font: 12px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(193, 226, 255, .3); border-top-color: var(--link); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 8px; background: #1c3558; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: min(600px, calc(100vw - 32px)); overflow-wrap: anywhere; pointer-events: auto; }
.toast.err { border-color: var(--red); background: #4a2620; }
.toast.ok { border-color: var(--green); }
.loading { display: flex; align-items: center; gap: 10px; padding: 40px; color: var(--muted); }

/* ---------- login ---------- */
body.login { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(900px 600px at 50% 40%, #1a2f52, #0a1424 70%); }
.login-card { width: 404px; max-width: calc(100vw - 32px); padding: 34px 40px 36px; border-radius: 16px; background: rgba(27, 44, 74, .7); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); text-align: center; }
.login-card .logo { font-size: 32px; }
.login-card p.sub { margin: 10px 0 24px; }
.login-card .input { height: 40px; margin-bottom: 14px; border-color: transparent; background: rgba(255, 255, 255, .07); }
.login-card .btn { width: 100%; height: 40px; justify-content: center; margin-top: 8px; font-size: 15px; }
.login-card .err { min-height: 20px; margin: 4px 0 0; color: #ff9c85; font-size: 13px; }
.login-card .foot { margin-top: 18px; color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .page { padding: calc(var(--topbar-h) + 40px) 24px 50px; }
  .content { padding: 28px 24px 50px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .connect { grid-template-columns: repeat(2, 1fr); }
  table.apps .opt { display: none; }
}

/* ---------- database browser ---------- */
.strip .lockbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 18px; border: 0; border-radius: 5px; background: transparent; color: var(--green); }
.strip .lockbtn:hover { background: rgba(39, 174, 96, .18); }
.strip .clsbox { display: flex; flex-direction: column; line-height: 22px; }
.strip .clsbox b { font: 700 16px/22px var(--body); }
.strip .clsbox .count { font-size: 14px; color: #ccc; min-height: 22px; }
.strip .count { color: #ccc; font-size: 13px; }
.strip .tbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 5px; background: rgba(0, 0, 0, .18); font: 500 14px var(--body); color: #fff; }
.strip .tbtn:hover { background: rgba(255, 255, 255, .08); }
.strip .tbtn:disabled { opacity: .4; cursor: default; }
.strip .tbtn .pl { color: var(--green); display: inline-flex; }
.strip .tbtn.icon { width: 30px; padding: 0; justify-content: center; position: relative; }
.strip .tbtn.del { color: var(--red); }
.strip .tbtn.on::after { content: ""; position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.grid-wrap { flex: none; height: calc(100vh - var(--topbar-h) - var(--strip-h)); overflow: auto; position: relative; background: var(--bg); }
table.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 0; font: 14px var(--grid); color: #ccc; }
table.grid th, table.grid td { height: 36px; padding: 0 16px; border-right: 1px solid rgba(52, 80, 111, .45); border-bottom: 1px solid rgba(52, 80, 111, .45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; font-weight: 400; }
table.grid th { position: sticky; top: 0; z-index: 3; height: 40px; background: #1a283e; color: var(--text); cursor: pointer; user-select: none; }
table.grid th small { margin-left: 6px; color: var(--link); font-size: 12px; }
table.grid th .sort { float: right; margin-top: 2px; color: var(--link); }
table.grid th { position: sticky; }
table.grid th .rz { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 4; }
table.grid th .rz:hover { background: rgba(32, 138, 236, .6); }
.menu label .mv { width: 22px; height: 22px; padding: 0; justify-content: center; border: 0; border-radius: 4px; background: rgba(193, 226, 255, .1); color: var(--link); font-size: 12px; }
.menu label .mv:disabled { opacity: .25; }
table.grid th.chk, table.grid td.chk { width: 42px; padding: 0; text-align: center; cursor: default; }
table.grid th.addcol { width: 190px; background: var(--bg); border-right: 0; cursor: default; }
table.grid th.addcol button { height: 24px; padding: 0 10px; border: 0; border-radius: 4px; background: #2d4a6d; color: var(--text); font: 12px var(--body); }
table.grid td { cursor: default; }
table.grid td.sel { outline: 2px solid var(--blue); outline-offset: -2px; }
table.grid td .dim, table.grid td.dim { color: #7d929f; }
table.grid tr.picked td { background: rgba(32, 138, 236, .12); }
table.grid tr.fresh td { background: rgba(39, 174, 96, .1); }
table.grid tr.draftbar td { padding: 6px 4px 9px; background: transparent; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .55); }
table.grid tr.draftbar:hover td { background: transparent; }
table.grid tr.draftbar .btn { height: 22px; padding: 0 12px; margin-right: 8px; border-radius: 4px; font-size: 12px; }
.btn.ghost { border-color: var(--green); color: #6fdc9e; background: transparent; }
.modal.light .lrow .l small.bad { color: #c0392b; font-weight: 600; }
table.grid tbody tr:hover td { background: rgba(193, 226, 255, .04); }
table.grid tr.picked:hover td { background: rgba(32, 138, 236, .16); }
table.grid td .ptr { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 10px; border: 0; border-radius: 4px; background: #1c3e66; color: #6db6ff; vertical-align: middle; }
table.grid td .ptr:hover { background: var(--blue); color: #fff; }
table.grid input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--blue); }
.grid-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px 40px; color: var(--muted); font-size: 13px; position: sticky; left: 0; }
.grid-foot .addrow { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border: 1px solid var(--blue); border-radius: 50%; background: transparent; color: var(--blue); }
.cell-edit { position: absolute; z-index: 6; min-width: 200px; border: 2px solid var(--blue); border-radius: 2px; background: #0b1526; color: var(--text); font: 14px var(--grid); padding: 6px 14px; outline: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
textarea.cell-edit { min-width: 360px; min-height: 150px; resize: both; white-space: pre; }
textarea.cell-edit.string-edit { white-space: pre-wrap; overflow-wrap: anywhere; }
.pop { position: absolute; z-index: 60; padding: 12px; border-radius: 8px; background: #15345a; border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.pop .frow { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.pop .input, .pop select.input { height: 30px; background-color: rgba(0, 0, 0, .2); font-size: 13px; }
.pop .acts { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.menu label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.menu .sep { padding: 6px 10px 2px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.menu button:disabled { opacity: .4; cursor: default; background: transparent; }
.menu.tall { max-height: 60vh; overflow: auto; }

/* ---------- api console, config, jobs ---------- */
.fs-value select.bare, .fs-value textarea.bare { width: 100%; border: 0; background: transparent; outline: none; text-align: left; font: 13px var(--mono); }
.fs-value input.bare.left { text-align: left; font: 13px var(--mono); }
.fs-value textarea.bare { min-height: 70px; resize: vertical; }
.fs-value select.bare option { background: var(--bg); }
.toggle { display: inline-flex; border: 1px solid rgba(255, 255, 255, .5); border-radius: 5px; overflow: hidden; }
.toggle button { height: 28px; padding: 0 14px; border: 0; background: transparent; font-size: 13px; }
.toggle button.on { background: #e6e9ee; color: #1d293d; font-weight: 600; }
pre.result { margin: 0; padding: 14px 16px; min-height: 80px; max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: rgba(0, 0, 0, .2); font: 13px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.blank { margin: 70px auto; max-width: 520px; text-align: center; }
.blank .ghost { color: var(--link); margin-bottom: 14px; }
.blank h3 { margin: 0 0 10px; font: 600 16px var(--head); }
.blank p { margin: 0 0 16px; }
.h2x { margin: 0 0 6px; font: 600 30px/1.25 var(--head); }
.h2x::after { content: ""; display: block; width: 14px; height: 3px; margin-top: 4px; border-radius: 2px; background: linear-gradient(90deg, #2bb3c0, var(--green)); }
.lang { display: flex; gap: 8px; margin: 14px 0 0; }

.nodata { display: flex; gap: 24px; padding: 34px 40px; position: sticky; left: 0; }
.nodata .round { width: 46px; height: 46px; border-radius: 50%; background: #1c3e66; display: grid; place-items: center; color: var(--link); flex: none; }
.nodata h3 { margin: 0 0 4px; font: 500 18px var(--head); }
.nodata p { margin: 0 0 16px; }
@media (max-width: 1300px) { .connect { grid-template-columns: repeat(3, 1fr); } .topbar { padding: 0 24px; } }

/* ---------- light dialogs of the data browser (same look as Back4App's) ---------- */
.modal.light { width: min(580px, 100%); background: #fff; color: #0f1c32; border: 0; border-radius: 8px; font-family: var(--body); }
.modal.light.wide { width: min(700px, 100%); }
.modal.light header { justify-content: center; border: 0; padding: 26px 24px 0; font: 600 17px var(--body); }
.modal.light .body { padding: 10px 32px 0; }
.modal.light .lsub { margin: 0 0 22px; text-align: center; font-size: 16px; color: #2a3445; }
.modal.light .lrows { border-radius: 2px; overflow: hidden; }
.modal.light .lrow { display: flex; min-height: 72px; border-bottom: 1px solid #e3e3e3; }
.modal.light .lrow:last-child { border-bottom: 0; }
.modal.light .lrow .l { flex: 0 0 50%; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 14px 24px; background: #f6f6f6; }
.modal.light .lrow .l b { font-weight: 600; font-size: 14.5px; }
.modal.light .lrow .l small { font-size: 12.5px; line-height: 1.4; color: #1d293d; }
.modal.light .lrow .r { flex: 1; min-width: 0; display: flex; align-items: center; padding: 8px 16px; background: #ececec; }
.modal.light .lrow .r input:not([type]), .modal.light .lrow .r select { width: 100%; height: 40px; border: 0; background: transparent; color: #0f1c32; font: 15px var(--body); outline: none; }
.modal.light .lrow .r input::placeholder { color: #b9bdc4; }
.modal.light .lrow .r input:disabled { opacity: .4; }
.modal.light .lcheck { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.modal.light .lcheck input { width: 16px; height: 16px; accent-color: #0f1c32; }
.modal.light .lchecks { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 6px 0; }
.modal.light .lmode { display: flex; justify-content: flex-end; margin: 6px 0 12px; }
.modal.light .toggle { border-color: #d5d8dd; }
.modal.light .toggle button { color: #9aa1ad; height: 32px; padding: 0 18px; }
.modal.light .toggle button.on { background: #6b7280; color: #fff; }
.modal.light .toggle.green button.on { background: var(--green); color: #fff; }
.modal.light footer { border: 0; padding: 22px 32px 26px; align-items: center; }
.modal.light .btn { height: 34px; font-size: 14.5px; }
.modal.light .btn.lcancel { border: 1px solid #b9bdc4; background: #fff; color: #0f1c32; font-weight: 500; }
.modal.light .btn.green:disabled { opacity: .35; }
.modal.light .llink { color: var(--blue); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- full-width tables (Deployments, Environment Variables) ---------- */
table.list.wide th { padding: 12px 24px; color: var(--text); font: 400 13px var(--body); letter-spacing: 0; text-transform: none; background: rgba(193, 226, 255, .03); }
table.list.wide td { padding: 14px 24px; font-size: 13.5px; }
table.list.wide tr.sect td { padding: 10px 24px; background: rgba(0, 0, 0, .18); font-weight: 500; }

/* ---------- create a backend app ---------- */
.newapp { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px;
  background: radial-gradient(1300px 420px at 50% 108%, #1b4f86, transparent 72%), #000; }
.newapp .box { width: min(510px, 100%); padding: 34px 40px 36px; border-radius: 10px; background: #0f1c32; border: 1px solid var(--line-soft); }
.newapp .head { position: relative; display: flex; justify-content: center; margin-bottom: 26px; }
.newapp .head h2 { margin: 0; font: 600 21px var(--head); }
.newapp .backbtn { position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(193, 226, 255, .12); color: var(--link); }
.newapp .box > .input { height: 46px; margin-bottom: 16px; }
.newapp .box > .btn { width: 100%; height: 38px; justify-content: center; }
.newapp details { margin-top: 18px; }
.newapp summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.fs-value .mailpreview { display: block; padding: 0 2px 4px; text-align: left; font-size: 12px; color: #9fd8b5; overflow-wrap: anywhere; }
.uplist { max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 0; background: rgba(0, 0, 0, .15); }
.uplist > div { display: flex; gap: 12px; align-items: baseline; padding: 4px 12px; font-size: 12.5px; }
.uplist > div span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.uplist > div i { flex: none; font-style: normal; color: var(--muted); }
.uplist > div.bad span { text-decoration: line-through; opacity: .6; }
.uplist > div.bad i { color: #ff9c85; }
.menu small { display: block; font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
.explorer.dropping { outline: 2px dashed var(--green); outline-offset: -4px; }
/* table page: Import > / Export > sub-menus and the outcome shown inside the import / export dialogs */
.menu .hassub span:first-child { flex: 1; }
.menu .hassub .caret { font-size: 11px; opacity: .75; }
.menu.sub { z-index: 61; }
.modal.light .ioout { margin: 16px 0 4px; font-size: 13.5px; line-height: 1.55; color: #1d293d; }
.modal.light .ioout:empty { display: none; }
.modal.light .ioout.bad { color: #c0392b; font-weight: 600; }
.modal.light .ioout ul { max-height: 180px; overflow: auto; margin: 6px 0; padding-left: 20px; font-size: 12.5px; color: #8a2a1d; }
.modal.light .lrow .r input[type=file] { width: 100%; font-size: 13px; color: #1d293d; }
/* table page: dragging a column header to another place */
table.grid th.dragging { opacity: .4; }
body.coldrag, body.coldrag * { cursor: grabbing !important; user-select: none; }
.colghost { position: fixed; z-index: 70; pointer-events: none; padding: 6px 12px; border-radius: 6px; background: #1f3a63; border: 1px solid rgba(193, 226, 255, .35); color: #fff; font: 600 13px var(--mono); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); white-space: nowrap; }
.colline { position: fixed; z-index: 69; width: 3px; border-radius: 2px; background: var(--green); pointer-events: none; }
/* table page: editing a Date cell - the text plus a calendar and a time row, like Back4App's */
.cell-edit.date-edit { padding: 0; border: 0; background: transparent; box-shadow: none; min-width: 0; }
.date-edit > input { display: block; width: 100%; padding: 6px 14px; border: 2px solid var(--blue); border-radius: 2px; background: #0b1526; color: var(--text); font: 14px var(--grid); outline: none; }
.date-edit .picker { position: absolute; left: 0; top: 100%; width: 280px; padding: 12px 12px 0; border-radius: 0 0 4px 4px; background: #2e3238; color: #fff; font: 14px var(--body); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.date-edit.up .picker { top: auto; bottom: 100%; border-radius: 4px 4px 0 0; }
.date-edit .picker .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 15px; }
.date-edit .picker .nav { width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: #fff; font-size: 22px; line-height: 1; }
.date-edit .picker .nav:hover { background: rgba(255, 255, 255, .1); }
.date-edit .picker .wk, .date-edit .picker .days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.date-edit .picker .wk span { padding: 4px 0 6px; font-size: 13px; color: #d5d8de; }
.date-edit .picker .days span, .date-edit .picker .days button { height: 34px; }
.date-edit .picker .days button { border: 0; border-radius: 2px; background: transparent; color: #fff; font: 14px var(--body); }
.date-edit .picker .days button:hover { background: rgba(255, 255, 255, .12); }
.date-edit .picker .days button.on { background: #169cee; }
.date-edit .picker .time { display: flex; align-items: center; gap: 8px; margin: 10px -12px 0; padding: 12px; border-top: 1px solid #5a5f67; }
.date-edit .picker .time .tm { width: 44px; height: 34px; border: 1px solid #4b5058; border-radius: 4px; background: transparent; color: #fff; text-align: center; font: 14px var(--body); outline: none; }
.date-edit .picker .time .tm:focus { border-color: var(--blue); }
.date-edit .picker .time b { color: #169cee; }
.date-edit .picker .time .btn { margin-left: auto; }

/* Back4App-style File editor: a small dark popover, Upload file and clear control. */
.cell-edit.file-edit { padding: 14px 16px; border: 0; border-radius: 0 0 3px 3px; background: #2e3238; font: 14px var(--body); max-width: 420px; }
.file-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.file-upload { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 18px; border: 1px dashed #74787f; border-radius: 4px; background: transparent; color: inherit; font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.file-upload:hover { border-color: #169cee; color: #169cee; }
.file-upload:disabled { cursor: wait; opacity: .6; }
.file-clear { border: 0; padding: 6px; background: transparent; color: inherit; cursor: pointer; }
.file-current { overflow-wrap: anywhere; margin-bottom: 12px; }
.file-title { display: flex; align-items: center; gap: 8px; }
.file-details { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 520px; font-size: 12px; padding: 10px 0; }
.file-list details { margin-top: 8px; }
.file-list summary { cursor: pointer; color: var(--muted); }
.files-page { padding: 24px; }
.file-list .actions { display: flex; align-items: center; gap: 8px; }
.file-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-cell-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.file-cell .ptr { flex: 0 0 auto; margin: 0; }
.file-references { display: flex; flex-direction: column; gap: 10px; min-width: 180px; max-height: 240px; overflow: auto; }
.file-references a { display: flex; flex-direction: column; gap: 3px; }
.file-references .mono { font-size: 12px; }
.file-list .file-focused > td, .grid td.file-reference-target { background: rgba(22, 156, 238, .13); box-shadow: inset 0 2px #169cee, inset 0 -2px #169cee; }
.file-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.file-choice:hover { border-color: #169cee; background: rgba(22, 156, 238, .1); }
