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

/* eeestock — 2026-08-24
   Written from scratch, NOT copied from manage/style.css. That file is ~1150
   lines with eleven competing .stats layers and a :root that declares violet
   then overrides it with cyan further down, so its token names lie about
   their values. Everything below has ONE :root and the names match the hexes.

   Colour rules carried over from the portal/panel (they are correct):
     1. cyan family = structure and brand ONLY, never a status
     2. --good / --warn / --alert = verdict ONLY, never decoration
     3. a decorative tint may not reuse a verdict hex
   Boxes carry no verdict, so their accents come from the 3-tint decorative
   cycle. Amber and red are reserved here for low/zero stock, which IS one. */

:root{
  color-scheme:dark;
  --bg:#15151D; --bg-2:#1B1B25; --surface:#20202B; --surface-2:#282835;
  --line:rgba(255,255,255,.09); --line-2:rgba(255,255,255,.18);
  --text:#F5F5F9; --muted:#A9A9BA; --faint:#82828F; --label:#C9C9D8;

  --cyan:#67E8F9; --cyan-ink:#4FD3E8; --cyan-fill:#2FB6CE; --cyan-deep:#1E8FA6;
  --cyan-dim:rgba(103,232,249,.10);

  --good:#5CD6A0; --good-dim:rgba(92,214,160,.12);
  --warn:#E0A458; --warn-dim:rgba(224,164,88,.13);
  --alert:#F26D78; --alert-dim:rgba(242,109,120,.12);

  --display:'Space Grotesk',system-ui,sans-serif;
  --sans:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,monospace;

  --pad:22px; --maxw:1240px; --r:12px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--text);
  font:400 14px/1.5 var(--sans);-webkit-font-smoothing:antialiased;
  min-height:100%;position:relative
}

/* Static lattice underneath everything. The moving device field sits on top
   of this; both are decoration and neither takes pointer events. */
body::before{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;opacity:.5;
  background:
    radial-gradient(circle at 18% 12%, rgba(103,232,249,.055), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(127,180,245,.045), transparent 46%),
    repeating-linear-gradient(60deg,  rgba(255,255,255,.022) 0 1px, transparent 1px 128px),
    repeating-linear-gradient(-60deg, rgba(255,255,255,.022) 0 1px, transparent 1px 128px);
}

/* The drifting Arduinos, Pis, servos and passives. Fixed and full-viewport
   so canvas coordinates equal clientX/clientY with no offset maths. */
#devbg{
  position:fixed;inset:0;width:100%;height:100%;
  z-index:0;pointer-events:none;display:block
}

.wrap{position:relative;z-index:1}

/* ===== CURSOR AURA =========================================================
   Ported from the panel. --mx/--my are set per element by fx.js.
   ⚠️ background-IMAGE, never the `background` shorthand — every target below
   sets background-color, and the shorthand would wipe it and leave the
   element transparent over whatever is behind it.
   ⚠️ NO :focus aura. Focus outlives the cursor, so the gradient freezes at
   the last --mx/--my and reads as stuck. Hover only. */
.ccard,.btn,.crow,.filterbar input,.loginbox input,
.fbody input,.fbody select,.fbody textarea{
  transition:background-image .18s ease,border-color .18s ease,
             transform .14s ease,box-shadow .14s ease
}
.ccard:not(:hover),.btn:not(:hover):not(.fill),.crow:not(:hover),
.filterbar input:not(:hover),.loginbox input:not(:hover),
.fbody input:not(:hover),.fbody select:not(:hover),
.fbody textarea:not(:hover){background-image:none}

/* ---------- header ------------------------------------------------------ */
header{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:14px var(--pad);border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,var(--bg-2),rgba(27,27,37,0));
  max-width:var(--maxw);margin:0 auto
}
.brand{display:flex;align-items:baseline;gap:9px;min-width:0}
.brand b{
  font:700 17px var(--display);letter-spacing:.02em;color:var(--text);
  white-space:nowrap
}
.brand i{
  font-style:normal;font:500 10px var(--mono);letter-spacing:.16em;
  text-transform:uppercase;color:var(--cyan-ink);opacity:.85
}
.who{display:flex;align-items:center;gap:12px;font-size:12.5px;color:var(--muted)}
.who b{color:var(--label);font-weight:600}

/* ---------- section header (the hairline rule) -------------------------- */
.sgroup{max-width:var(--maxw);margin:26px auto 16px;padding:0 var(--pad)}
/* ---------- section header (the hairline rule) --------------------------
   ⚠️ The rule is a real <span class="grule">, NOT ::after. A pseudo-element
   is always the last child, so the action buttons could never sit after it. */
.glabel{display:flex;align-items:center;gap:12px;margin:0 0 14px}
.gtick{
  width:3px;height:18px;border-radius:2px;flex-shrink:0;
  background:linear-gradient(180deg,var(--cyan),var(--cyan-deep))
}
/* Section names are user-editable now, so this is a real heading in the
   display face — NOT the panel's 10.5px mono caps. Seven of these are the
   primary structure of the page, and forcing uppercase would misrepresent
   whatever the operator actually typed. */
.gname{
  font:600 17px/1.2 var(--display);letter-spacing:.005em;color:var(--text);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:50%
}
.grule{
  flex:1;height:2px;min-width:16px;border-radius:1px;
  background:linear-gradient(90deg,rgba(103,232,249,.42),rgba(103,232,249,.03))
}
.gacts{display:flex;align-items:center;gap:6px;flex-shrink:0}
.gacts form{display:inline;margin:0}

/* ---------- .mini — ported from the panel's subscriber row actions -------
   Filled tinted pills with an icon and a title tooltip, as manage/style.css
   line 329. `good` = create, `del` = destroy, plain = edit. Deliberately NOT
   in the cursor-aura set: these carry their own hover fill, as the panel's do. */
.mini{
  display:inline-flex;align-items:center;gap:6px;padding:6px 11px;
  font:500 12.5px var(--sans);background-color:var(--surface-2);color:var(--label);
  border:1px solid transparent;border-radius:8px;cursor:pointer;
  text-decoration:none;
  transition:background-color .18s ease,border-color .18s ease,color .18s ease
}
.mini .ic{width:15px;height:15px;flex-shrink:0}
.mini:hover{background-color:rgba(103,232,249,.13);border-color:rgba(103,232,249,.45);color:var(--text)}
.mini:focus-visible{outline:2px solid var(--cyan-deep);outline-offset:1px}
.mini.good{background-color:var(--cyan-dim);color:var(--cyan-ink);border-color:rgba(103,232,249,.3)}
.mini.good:hover{background-color:rgba(103,232,249,.17);border-color:rgba(103,232,249,.55);color:var(--cyan)}
.mini.del{background-color:var(--alert-dim);color:var(--alert);border-color:rgba(242,109,120,.26)}
.mini.del:hover{background-color:rgba(242,109,120,.2);border-color:rgba(242,109,120,.55);color:var(--alert)}
/* Labels collapse to icon-only when space is tight; the title attribute
   still names the action, and touch users get a squarer target. */
@media (max-width:920px){
  .mini .mtxt{display:none}
  .mini{padding:8px 9px}
}

/* ⚠️ Bottom space is PADDING, not margin. As the last element inside .wrap,
   a bottom margin collapses straight through .wrap and body and produces no
   visible gap at all — the button ends up flush against the viewport edge. */
.addsec{max-width:var(--maxw);margin:26px auto 0;padding:0 var(--pad) 80px}

/* ---------- box cards --------------------------------------------------- */
.closets{
  display:grid;gap:12px;
  grid-template-columns:repeat(auto-fill,minmax(212px,1fr))
}
.ccard{
  --tint:var(--cyan);--tint-glow:rgba(103,232,249,.30);
  appearance:none;-webkit-appearance:none;text-align:left;cursor:pointer;
  display:flex;flex-direction:column;gap:4px;
  padding:15px 17px 16px;border-radius:var(--r);
  background-color:var(--surface);border:1px solid var(--line);color:var(--text);
  font-family:var(--sans)
}
/* Cycle is scoped to .closets, so it restarts inside every section instead
   of drifting across all 21 boxes. */
.closets>.ccard:nth-child(3n+1){--tint:#67E8F9;--tint-glow:rgba(103,232,249,.30)}
.closets>.ccard:nth-child(3n+2){--tint:#7FB4F5;--tint-glow:rgba(127,180,245,.28)}
.closets>.ccard:nth-child(3n+3){--tint:#34D0C3;--tint-glow:rgba(52,208,195,.28)}
.ccard:hover{
  transform:translateY(-2px);border-color:var(--line-2);
  box-shadow:0 8px 26px rgba(0,0,0,.34);
  /* the card glows in its OWN hue, not a uniform cyan */
  background-image:radial-gradient(240px circle at var(--mx,50%) var(--my,50%),
    var(--tint-glow),transparent 68%)
}
.ccard:focus-visible{outline:2px solid var(--tint);outline-offset:2px}
.ccard .clabel{
  font:700 10.5px var(--mono);letter-spacing:.14em;text-transform:uppercase;
  color:var(--tint)
}
.ccard b{font:600 30px/1 var(--display);color:var(--text);margin-top:3px}
.ccard .csub{font:400 11.5px var(--mono);color:var(--tint);opacity:.72}
.ccard .cempty{color:var(--faint);opacity:1}

/* ---------- buttons ----------------------------------------------------- */
.btn{
  appearance:none;cursor:pointer;border-radius:9px;font:600 12.5px var(--sans);
  padding:8px 14px;border:1px solid var(--line-2);background-color:transparent;
  color:var(--label)
}
.btn:hover{
  color:var(--text);
  background-image:radial-gradient(150px circle at var(--mx,50%) var(--my,50%),
    rgba(103,232,249,.20),transparent 66%)
}
/* .fill already uses background-image for its gradient, so the aura has to
   be LAYERED above it rather than replacing it. */
.btn.fill{
  border-color:transparent;color:#06222A;font-weight:700;
  background-color:var(--cyan-fill);
  background-image:linear-gradient(180deg,var(--cyan),var(--cyan-fill))
}
.btn.fill:hover{
  color:#06222A;
  background-image:
    radial-gradient(150px circle at var(--mx,50%) var(--my,50%),
      rgba(255,255,255,.26),transparent 62%),
    linear-gradient(180deg,var(--cyan),var(--cyan-fill))
}
.btn.danger{border-color:rgba(242,109,120,.34);color:var(--alert)}
.btn.danger:hover{
  color:var(--alert);
  background-image:radial-gradient(150px circle at var(--mx,50%) var(--my,50%),
    rgba(242,109,120,.22),transparent 66%)
}
.btn.mini{padding:5px 10px;font-size:11.5px;border-radius:7px}

/* ---------- modal ------------------------------------------------------- */
.modal{
  position:fixed;inset:0;z-index:60;display:flex;align-items:flex-start;
  justify-content:center;padding:24px 14px;overflow-y:auto;
  background:rgba(8,8,13,.72);backdrop-filter:blur(3px)
}
.modal[hidden]{display:none}
.sheet{
  width:100%;max-width:880px;margin:auto;background:var(--bg-2);
  border:1px solid var(--line-2);border-radius:14px;
  box-shadow:0 26px 70px rgba(0,0,0,.6);overflow:hidden
}
.sheethead{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:15px 18px;border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,var(--surface),var(--bg-2))
}
.sheethead .t b{display:block;font:600 16px var(--display)}
.sheethead .t span{
  display:block;margin-top:3px;font:400 11px var(--mono);color:var(--cyan-ink);opacity:.75
}
.hact{display:flex;align-items:center;gap:8px;flex-shrink:0;flex-wrap:wrap}
.hact form{display:inline;margin:0}

.filterbar{padding:12px 18px 0}
.filterbar input{
  width:100%;padding:9px 12px;border-radius:9px;background-color:var(--bg);
  border:1px solid var(--line);color:var(--text);font:400 13px var(--sans)
}
.filterbar input:hover{
  border-color:rgba(103,232,249,.4);
  background-image:radial-gradient(180px circle at var(--mx,50%) var(--my,50%),
    rgba(103,232,249,.18),transparent 66%)
}
.filterbar input:focus{outline:none;border-color:var(--cyan-deep)}

.rows{padding:12px 18px 18px;display:flex;flex-direction:column;gap:8px}
.crow{
  display:flex;align-items:center;gap:13px;padding:10px 12px;
  background-color:var(--surface);border:1px solid var(--line);border-radius:10px
}
.crow:hover{
  border-color:var(--line-2);
  background-image:radial-gradient(300px circle at var(--mx,50%) var(--my,50%),
    rgba(103,232,249,.10),transparent 70%)
}
.crow[hidden]{display:none}
.thumb{
  width:52px;height:52px;flex-shrink:0;border-radius:8px;object-fit:cover;
  background:var(--surface-2);border:1px solid var(--line)
}
.thumb.ph{
  display:flex;align-items:center;justify-content:center;
  font:700 9px var(--mono);letter-spacing:.1em;color:var(--faint)
}
.cmain{min-width:0;flex:1}
.cmain b{display:block;font:600 13.5px var(--sans);color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cmeta{
  display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:3px;
  font:400 11px var(--mono);color:var(--faint)
}
.cmeta a{color:var(--cyan-ink);text-decoration:none}
.cmeta a:hover{text-decoration:underline}
.qty{
  flex-shrink:0;min-width:52px;text-align:right;
  font:600 16px var(--display);color:var(--text)
}
.qty.zero{color:var(--alert)}
.qty.low{color:var(--warn)}
.racts{display:flex;gap:6px;flex-shrink:0}
.racts form{margin:0}
.note{
  margin-top:4px;font:400 11.5px var(--sans);color:var(--muted);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.empty{padding:26px 4px;text-align:center;color:var(--faint);font-size:13px}

/* ---------- form -------------------------------------------------------- */
.form{display:flex;flex-direction:column}
.fbody{padding:16px 18px;display:grid;gap:13px;grid-template-columns:1fr 1fr}
.fbody label{display:flex;flex-direction:column;gap:5px;min-width:0}
.fbody label.wide{grid-column:1/-1}
.fbody span.lb,.loginbox span.lb{
  font:700 10px var(--mono);letter-spacing:.13em;text-transform:uppercase;
  color:var(--faint)
}
.fbody input,.fbody select,.fbody textarea{
  width:100%;padding:9px 11px;border-radius:9px;background-color:var(--bg);
  border:1px solid var(--line);color:var(--text);font:400 13px var(--sans)
}
.fbody textarea{resize:vertical;min-height:62px}
.fbody input:hover,.fbody select:hover,.fbody textarea:hover{
  border-color:rgba(103,232,249,.4);
  background-image:radial-gradient(180px circle at var(--mx,50%) var(--my,50%),
    rgba(103,232,249,.18),transparent 66%)
}
.fbody input:focus,.fbody select:focus,.fbody textarea:focus{
  outline:none;border-color:var(--cyan-deep)
}
.fbody input[type=file]{padding:7px 9px;font-size:12px;color:var(--muted)}
.chk{flex-direction:row!important;align-items:center;gap:8px!important}
.chk span.lb{letter-spacing:.04em;text-transform:none;font-family:var(--sans);
  font-size:12px;color:var(--muted);font-weight:400}
.formfoot{
  display:flex;justify-content:flex-end;gap:8px;padding:14px 18px;
  border-top:1px solid var(--line);background:var(--surface)
}

/* ---------- flash ------------------------------------------------------- */
.flash{
  max-width:var(--maxw);margin:14px auto 0;padding:10px 14px;
  border-radius:9px;font-size:13px;position:relative;z-index:1;
  margin-inline:auto;width:calc(100% - var(--pad)*2)
}
.flash.err{background:var(--alert-dim);border:1px solid rgba(242,109,120,.3);color:#FCA5A5}
.flash.ok{background:var(--good-dim);border:1px solid rgba(92,214,160,.3);color:#A7F3D0}

/* ---------- login ------------------------------------------------------- */
.loginwrap{
  min-height:100dvh;display:flex;align-items:center;justify-content:center;
  padding:24px;position:relative;z-index:1
}
.loginbox{
  width:100%;max-width:360px;background:var(--bg-2);border:1px solid var(--line-2);
  border-radius:14px;padding:26px 24px;box-shadow:0 26px 70px rgba(0,0,0,.5)
}
.loginbox .brand{justify-content:center;margin-bottom:4px}
.loginbox .sub{
  text-align:center;font:400 11.5px var(--mono);color:var(--faint);
  margin:0 0 20px
}
.loginbox label{display:flex;flex-direction:column;gap:5px;margin-bottom:13px}
.loginbox input{
  width:100%;padding:10px 12px;border-radius:9px;background-color:var(--bg);
  border:1px solid var(--line);color:var(--text);font:400 14px var(--sans)
}
.loginbox input:hover{
  border-color:rgba(103,232,249,.4);
  background-image:radial-gradient(180px circle at var(--mx,50%) var(--my,50%),
    rgba(103,232,249,.18),transparent 66%)
}
.loginbox input:focus{outline:none;border-color:var(--cyan-deep)}
.loginbox .btn{width:100%;margin-top:6px;padding:11px}

/* ---------- responsive -------------------------------------------------- */
@media (max-width:820px){
  :root{--pad:14px}
  .closets{grid-template-columns:repeat(2,1fr)}
  .ccard b{font-size:26px}
  .fbody{grid-template-columns:1fr}
  .sheethead{flex-wrap:wrap}
  header{flex-wrap:wrap}
}
@media (max-width:560px){
  /* The row reflows rather than squeezing: the action buttons drop to their
     own line instead of shrinking the name to three characters. */
  .crow{flex-wrap:wrap;row-gap:9px}
  .cmain{flex:1 1 auto;order:2}
  .thumb{order:1}
  .qty{order:3;min-width:auto}
  .racts{order:4;width:100%;justify-content:flex-end;
    border-top:1px solid var(--line);padding-top:9px}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none!important}
  .ccard:hover{transform:none}
}
