/* 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)}
nav{display:flex;align-items:center;justify-content:space-between;height:68px;gap:16px}
.logo{display:flex;align-items:center;gap:11px;font-weight:800;font-size:23px;white-space:nowrap}
.logo img{width:40px;height:40px;border-radius:11px;object-fit:contain}
/* The nav must stay on ONE line even for an admin (7 items) with a long email.
   white-space:nowrap is the real fix — without it each label broke in half
   ("My / Datasets"). min-width:0 lets the row shrink instead of overflowing. */
.navlinks{display:flex;gap:3px;flex:1;margin-left:16px;min-width:0}
.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)}
.user-chip{display:flex;align-items:center;gap:10px;min-width: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 is the ONLY thing allowed to shrink. If space runs out it trims with
   "…" instead of pushing a menu item onto a second line. 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}
/* A long email is what pushes the menu over the edge. Below 1180px we drop the
   text — the avatar keeps it on hover — so every menu item stays visible. */
@media(max-width:1180px){.user-email{display:none}}
@media(max-width:1040px){.navlinks a{padding:8px 10px;font-size:13.5px}}
@media(max-width:820px){.navlinks{display:none}}

/* 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}}
