/* platform.css — shared theme + components for the platform pages.
   Matches dashboard.html so the new pages feel native. Load on every new page. */
:root{
  --bg:#06070d; --bg2:#0b0e1a; --panel:rgba(255,255,255,.04);
  --panel-brd:rgba(255,255,255,.09); --txt:#e9ecff; --muted:#98a0c9;
  --brand:#6d5efc; --brand2:#22d3ee; --ok:#34d399; --warn:#fbbf24; --bad:#f87171;
  --radius:18px; --maxw:1180px; --grad:linear-gradient(120deg,#6d5efc,#22d3ee);
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:var(--bg);color:var(--txt);line-height:1.6;min-height:100vh;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 24px}

#app{display:none}
#gate{min-height:100vh;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:14px}
.spinner-lg{width:34px;height:34px;border:3px solid var(--panel-brd);border-top-color:var(--brand2);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
#gate p{color:var(--muted);font-size:14.5px}

header{position:sticky;top:0;z-index:50;backdrop-filter:blur(14px);background:rgba(6,7,13,.6);border-bottom:1px solid var(--panel-brd)}
/* ---------------------------------------------------------------------------
   THE HEADER — why it is built this way
   ---------------------------------------------------------------------------
   The old version used @media (max-width: …) to shrink the menu. That could
   never work here, and this is the trap to remember: the page container is
   capped at --maxw, so on ANY monitor wider than that the nav is the SAME
   width. A 1440px screen and a 1200px screen both give the nav 1132px. The
   media queries were asking about the WINDOW, which on a big screen is never
   small, so they never fired — while the menu was overflowing the whole time.
   That is why the bell sat on top of "Admin" for an admin account.

   Two changes make an overlap structurally impossible, at any width, with any
   number of menu items:

   1. The menu row SCROLLS sideways instead of spilling. A flex row whose
      children cannot shrink will always overflow eventually; letting it scroll
      means the overflow is contained and every item stays reachable. This is
      what mobile app bars do. It also means adding a 9th item cannot break
      the header again.

   2. The shrink steps are @container queries on the nav itself, so they react
      to the space the nav actually has — not to the size of the window.

   The platform header also gets a wider container than the page body: with
   8 items plus a long email, 1180px is genuinely not enough room, and losing
   the email on a large monitor looked broken.
--------------------------------------------------------------------------- */
header .wrap{max-width:1400px}
nav{display:flex;align-items:center;justify-content:space-between;height:68px;gap:16px;
  container-type:inline-size;container-name:pfnav}
.logo{display:flex;align-items:center;gap:11px;font-weight:800;font-size:23px;white-space:nowrap;flex-shrink:0}
.logo img{width:40px;height:40px;border-radius:11px;object-fit:contain;flex-shrink:0}
/* white-space:nowrap on the links is the reason labels never break in half
   ("My / Datasets"). min-width:0 lets the ROW shrink; overflow-x lets what does
   not fit scroll instead of landing on top of the user chip. */
.navlinks{display:flex;gap:3px;flex:1 1 auto;margin-left:16px;min-width:0;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none}
.navlinks::-webkit-scrollbar{display:none}
.navlinks a{padding:8px 12px;border-radius:10px;font-size:14px;color:var(--muted);font-weight:600;
  white-space:nowrap;flex-shrink:0}
.navlinks a:hover,.navlinks a.active{background:var(--panel);color:var(--txt)}
/* flex-shrink:0 — the user chip must never be squashed into the menu. */
.user-chip{display:flex;align-items:center;gap:10px;min-width:0;flex-shrink:0}
.avatar{width:34px;height:34px;border-radius:50%;background:var(--grad);display:grid;place-items:center;color:#08111e;font-weight:800;font-size:14px;flex-shrink:0}
/* The email trims with "…" rather than pushing anything out. Hover the avatar
   for the full address. */
.user-email{font-size:13.5px;color:var(--muted);white-space:nowrap;
  max-width:190px;overflow:hidden;text-overflow:ellipsis;min-width:0}

/* Shrink steps, measured against the NAV's own width (not the window).
   Room needed, worst case (admin, 8 items, long email): ~1330px.
   Each step below removes the next least useful thing. */
@container pfnav (max-width:1330px){ .user-email{display:none} }
@container pfnav (max-width:1130px){ .navlinks a{padding:8px 9px;font-size:13.5px} }
@container pfnav (max-width:1090px){ .navlinks{gap:1px}.navlinks a{padding:7px 7px;font-size:13px} }
/* Phone: drop the wordmark, keep the mark. font-size:0 hides the text node
   without needing a <span> around it in platform.js. The menu still scrolls,
   so navigation is never lost — it used to disappear completely below 900px. */
@container pfnav (max-width:760px){ .logo{font-size:0;gap:0} }

/* Fallback for a browser with no @container support: the old window-based
   steps. They fire late, but the scrolling menu above already prevents the
   overlap, so this is only about looking tidy. */
@supports not (container-type: inline-size){
  @media(max-width:1400px){.user-email{display:none}}
  @media(max-width:1130px){.navlinks a{padding:8px 9px;font-size:13.5px}}
  @media(max-width:1090px){.navlinks{gap:1px}.navlinks a{padding:7px 7px;font-size:13px}}
  @media(max-width:760px){.logo{font-size:0;gap:0}}
}

/* Summary cards + key/value rows — used by the dashboard, shared so any future
   page gets the same look without copying styles into its own <style> block. */
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin-top:36px}
@media(max-width:860px){.grid{grid-template-columns:1fr}}
.card{background:var(--panel);border:1px solid var(--panel-brd);border-radius:var(--radius);padding:26px}
.card h3{font-size:17px;margin-bottom:6px}
.card p{color:var(--muted);font-size:14px}
.card b{font-size:26px;display:block;margin-top:6px}
.kv{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-bottom:1px solid var(--panel-brd);font-size:14px}
.kv:last-child{border-bottom:0}
.kv span:first-child{color:var(--muted);flex-shrink:0}
.kv span:last-child{text-align:right;word-break:break-all}

.btn{display:inline-flex;align-items:center;gap:9px;padding:10px 18px;border-radius:11px;font-weight:650;font-size:14px;cursor:pointer;border:1px solid var(--panel-brd);background:var(--panel);color:var(--txt);transition:.2s;white-space:nowrap}
.btn:hover{background:rgba(255,255,255,.08)}
.btn.primary{background:var(--grad);color:#08111e;border:0}
.btn.primary:hover{opacity:.92}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn.sm{padding:7px 13px;font-size:13px;border-radius:9px}

main{padding:48px 0}
.hello h1{font-size:clamp(24px,3.2vw,32px);font-weight:800;letter-spacing:-.02em}
.hello p{color:var(--muted);margin-top:8px;font-size:15px}

.panel{margin-top:24px;background:var(--panel);border:1px solid var(--panel-brd);border-radius:var(--radius);padding:26px}
.panel h3{font-size:16px;margin-bottom:16px}
.note{margin-top:16px;background:rgba(251,191,36,.08);border:1px solid rgba(251,191,36,.3);border-radius:12px;padding:14px 16px;font-size:13.5px;color:#f4d488}

label{display:block;font-size:13.5px;color:var(--muted);margin:16px 0 7px}
input,textarea,select{width:100%;padding:12px 14px;border-radius:11px;border:1px solid var(--panel-brd);background:var(--bg2);color:var(--txt);font-size:14.5px;font-family:inherit}
input:focus,textarea:focus,select:focus{outline:none;border-color:var(--brand)}
textarea{min-height:88px;resize:vertical}
.hint{font-size:12.5px;color:var(--muted);margin-top:6px}

.tablewrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{text-align:left;padding:13px 12px;border-bottom:1px solid var(--panel-brd);white-space:nowrap}
th{color:var(--muted);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.03em}
tr:last-child td{border-bottom:0}
.empty{color:var(--muted);text-align:center;padding:34px 0;font-size:14px}

.badge{display:inline-block;padding:4px 11px;border-radius:20px;font-size:12px;font-weight:700;text-transform:capitalize}
.badge.pending{background:rgba(148,160,201,.15);color:var(--muted)}
.badge.processing{background:rgba(34,211,238,.15);color:var(--brand2)}
.badge.completed{background:rgba(52,211,153,.15);color:var(--ok)}
.badge.failed{background:rgba(248,113,113,.15);color:var(--bad)}
.badge.cancelled{background:rgba(251,191,36,.15);color:var(--warn)}
code{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;color:var(--brand2)}

.toast{position:fixed;right:20px;bottom:20px;background:var(--bg2);border:1px solid var(--panel-brd);padding:14px 18px;border-radius:12px;font-size:14px;max-width:360px;z-index:100;opacity:0;transform:translateY(10px);transition:.25s;pointer-events:none}
.toast.show{opacity:1;transform:translateY(0)}
.toast.ok{border-color:rgba(52,211,153,.5)}
.toast.err{border-color:rgba(248,113,113,.5)}

/* ---- notification bell (shared header) ---- */
.notif-wrap{position:relative}
.notif-bell{position:relative;background:var(--panel);border:1px solid var(--panel-brd);color:var(--txt);
  width:38px;height:38px;border-radius:50%;cursor:pointer;font-size:15px;display:grid;place-items:center;transition:.2s}
.notif-bell:hover{background:rgba(255,255,255,.08)}
.notif-dot{position:absolute;top:8px;right:9px;width:9px;height:9px;background:var(--bad);border-radius:50%;box-shadow:0 0 0 2px var(--bg)}
.notif-panel{position:absolute;right:0;top:48px;width:340px;max-height:440px;overflow:auto;background:var(--bg2);
  border:1px solid var(--panel-brd);border-radius:14px;box-shadow:0 20px 50px -20px rgba(0,0,0,.85);z-index:120}
.notif-head{padding:14px 16px;font-weight:700;font-size:14px;border-bottom:1px solid var(--panel-brd);position:sticky;top:0;background:var(--bg2)}
.notif-empty{padding:26px 16px;color:var(--muted);font-size:13.5px;text-align:center}
.notif-item{display:flex;gap:11px;padding:13px 16px;border-bottom:1px solid var(--panel-brd)}
.notif-item:last-child{border-bottom:0}
.notif-item.unread{background:rgba(109,94,252,.06)}
.notif-ic{width:9px;height:9px;border-radius:50%;margin-top:6px;flex-shrink:0;background:var(--muted)}
.notif-ic.success{background:var(--ok)}.notif-ic.warning{background:var(--warn)}
.notif-ic.critical{background:var(--bad)}.notif-ic.info{background:var(--brand2)}
.notif-title{font-weight:650;font-size:13.5px}
.notif-body{font-size:12.5px;color:var(--muted);margin-top:2px}
.notif-time{font-size:11.5px;color:var(--muted);margin-top:4px}
@media(max-width:820px){.notif-panel{width:290px}}
