:root{
  --fe-primary:#1A2E6F; --fe-primary-2:#2D4DB3; --fe-accent:#FF6B35;
  --fe-light:#F4F6FB; --fe-white:#fff; --fe-text:#1C2B3A; --fe-muted:#6B7A8D;
  --fe-border:#E2E8F0; --fe-success:#22C55E; --fe-warn:#F59E0B; --fe-danger:#EF4444;
  --fe-grad:linear-gradient(135deg,#1A2E6F 0%,#2D4DB3 100%);
  --shadow-sm:0 1px 3px rgba(16,32,72,.06),0 1px 2px rgba(16,32,72,.04);
  --shadow-md:0 4px 16px rgba(26,46,111,.10);
  --shadow-lg:0 12px 32px rgba(26,46,111,.16);
  --radius:12px; --radius-btn:8px;
  --ease:cubic-bezier(.4,0,.2,1);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--fe-light);color:var(--fe-text);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;line-height:1.6;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
h1,h2,h3{font-family:'Plus Jakarta Sans',Inter,sans-serif;margin:0 0 .4em;letter-spacing:-.01em}
h1{font-size:1.8rem;font-weight:800} h2{font-size:1.3rem;font-weight:700}
a{color:var(--fe-primary-2);text-decoration:none;transition:color .15s var(--ease)} a:hover{text-decoration:underline}
::selection{background:rgba(45,77,179,.16)}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:99px;border:2px solid var(--fe-light)}
::-webkit-scrollbar-thumb:hover{background:#94a3b8}

/* Layout shell */
.app{display:flex;min-height:100vh}
.sidebar{width:230px;background:var(--fe-grad);color:#fff;padding:1.25rem 0;flex-shrink:0;
  position:sticky;top:0;height:100vh;overflow-y:auto}
.sidebar .brand{font-family:'Plus Jakarta Sans';font-weight:800;font-size:1.15rem;
  padding:.2rem 1.25rem 1rem;display:flex;align-items:center;gap:.5rem;letter-spacing:-.01em}
.sidebar .brand .logo{background:#fff;color:var(--fe-primary);border-radius:8px;
  width:30px;height:30px;display:grid;place-items:center;font-weight:900;font-size:.85rem;
  box-shadow:0 2px 8px rgba(0,0,0,.18);flex-shrink:0}
.sidebar nav a{position:relative;display:flex;align-items:center;gap:.65rem;color:#c7d3f5;
  padding:.6rem 1.25rem;font-size:.95rem;font-weight:500;transition:background .15s var(--ease),color .15s var(--ease)}
.sidebar nav a:hover,.sidebar nav a.active{background:rgba(255,255,255,.12);color:#fff;text-decoration:none}
.sidebar nav a.active{font-weight:600}
.sidebar nav a.active::before{content:"";position:absolute;left:0;top:.4rem;bottom:.4rem;width:3px;
  background:var(--fe-accent);border-radius:0 3px 3px 0}
.sidebar nav a .nav-ico{width:19px;height:19px;flex-shrink:0;opacity:.72;
  transition:opacity .15s var(--ease),transform .15s var(--ease)}
.sidebar nav a:hover .nav-ico{opacity:1;transform:translateX(1px)}
.sidebar nav a.active .nav-ico{opacity:1;color:#fff}
.sidebar .tag{font-size:.68rem;text-transform:uppercase;letter-spacing:.1em;
  color:#8fa3dd;padding:1rem 1.25rem .3rem;font-weight:600}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{background:rgba(255,255,255,.82);backdrop-filter:saturate(1.4) blur(8px);
  border-bottom:1px solid var(--fe-border);padding:.8rem 1.5rem;
  display:flex;justify-content:space-between;align-items:center;
  position:sticky;top:0;z-index:20}
.topbar .who{color:var(--fe-muted);font-size:.9rem}
.content{padding:1.75rem 1.5rem;flex:1;max-width:1280px;width:100%}
.content>h1:first-child,.content>.toolbar:first-child{animation:fade-in .3s var(--ease)}
@keyframes fade-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* Cards / tables */
.card{background:#fff;border:1px solid var(--fe-border);border-radius:var(--radius);
  box-shadow:var(--shadow-sm);padding:1.25rem;margin-bottom:1.25rem}
.grid{display:grid;gap:1rem}.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.stat{position:relative;background:#fff;border:1px solid var(--fe-border);border-radius:var(--radius);
  padding:1.25rem;box-shadow:var(--shadow-sm);overflow:hidden;
  transition:transform .18s var(--ease),box-shadow .18s var(--ease),border-color .18s var(--ease)}
.stat::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--fe-grad);
  opacity:0;transition:opacity .18s var(--ease)}
a.stat:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);border-color:#c7d2fe;text-decoration:none}
a.stat:hover::before{opacity:1}
.stat .num{font-family:'Plus Jakarta Sans';font-size:2.2rem;font-weight:800;color:var(--fe-primary);line-height:1.1}
.stat .lbl{color:var(--fe-muted);font-size:.9rem;margin-top:.15rem}
table{width:100%;border-collapse:collapse;font-size:.92rem}
th,td{text-align:left;padding:.65rem .7rem;border-bottom:1px solid var(--fe-border);vertical-align:top}
thead th{position:sticky;top:0;background:#fff;z-index:1}
th{color:var(--fe-muted);font-weight:600;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em}
tbody tr{transition:background .12s var(--ease)}
tr:hover td{background:#f7f9ff}
tbody tr:last-child td{border-bottom:none}
.badge{display:inline-block;padding:.15rem .55rem;border-radius:999px;font-size:.72rem;font-weight:600;
  line-height:1.5;white-space:nowrap}
.badge.brand{background:#eef2ff;color:var(--fe-primary-2)}
.badge.muted{background:#f1f5f9;color:var(--fe-muted)}
.badge.ok,.badge.success{background:#dcfce7;color:#15803d}
.badge.warn{background:#fef3c7;color:#b45309}
.badge.danger{background:#fee2e2;color:#b91c1c}

/* Forms + buttons */
label{display:block;font-size:.85rem;font-weight:600;margin:.7rem 0 .25rem;color:var(--fe-text)}
input,select,textarea{width:100%;padding:.55rem .7rem;border:1px solid var(--fe-border);
  border-radius:var(--radius-btn);font:inherit;background:#fff;color:var(--fe-text);
  transition:border-color .15s var(--ease),box-shadow .15s var(--ease)}
input::placeholder,textarea::placeholder{color:#9aa8b8}
input:hover,select:hover,textarea:hover{border-color:#c7d2e0}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--fe-primary-2);
  box-shadow:0 0 0 3px rgba(45,77,179,.14)}
/* Native file inputs: style the browser's default "Choose files" button so it
   reads as a .btn.secondary.sm instead of the mismatched OS control. */
input[type=file]{padding:.3rem .45rem;cursor:pointer;color:var(--fe-muted);font-size:.85rem;line-height:1.9}
input[type=file]::file-selector-button,
input[type=file]::-webkit-file-upload-button{
  margin-right:.7rem;padding:.4rem .9rem;border:1.5px solid #c7d2e6;border-radius:var(--radius-btn);
  background:#fff;color:var(--fe-primary);font:inherit;font-weight:600;font-size:.82rem;cursor:pointer;
  transition:background .15s var(--ease),border-color .15s var(--ease),color .15s var(--ease)}
input[type=file]::file-selector-button:hover{background:#f7f9ff;border-color:var(--fe-primary-2);color:var(--fe-primary-2)}
.row{display:flex;gap:1rem;flex-wrap:wrap}.row>div{flex:1;min-width:180px}
/* All variants share ONE box model: same padding + a 1.5px border (transparent
   on filled buttons) so a primary, secondary or ghost button are pixel-identical
   in height. Only .sm changes the size — uniformly across every variant. */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;background:var(--fe-accent);color:#fff;
  border:1.5px solid transparent;cursor:pointer;
  padding:.55rem 1.3rem;border-radius:var(--radius-btn);font-weight:600;font-size:.9rem;line-height:1.2;
  box-shadow:0 2px 6px rgba(255,107,53,.25);
  transition:transform .12s var(--ease),box-shadow .15s var(--ease),filter .15s var(--ease),background .15s var(--ease),border-color .15s var(--ease)}
.btn:hover{filter:brightness(1.04);text-decoration:none;color:#fff;box-shadow:0 4px 12px rgba(255,107,53,.32);transform:translateY(-1px)}
.btn:active{transform:translateY(0);box-shadow:0 1px 3px rgba(255,107,53,.3)}
.btn:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(255,107,53,.35)}
.btn:disabled{opacity:.55;cursor:not-allowed;filter:grayscale(.2);box-shadow:none;transform:none}
.btn.secondary{background:#fff;color:var(--fe-primary);border-color:#c7d2e6;box-shadow:none}
.btn.secondary:hover{background:#f7f9ff;border-color:var(--fe-primary-2);color:var(--fe-primary-2);filter:none}
.btn.secondary:active{background:#eef2ff}
.btn.sm{padding:.4rem .85rem;font-size:.82rem}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.1rem;flex-wrap:wrap}
.search{flex:1;max-width:420px;position:relative}
.search input{padding-left:2.1rem}
.search::before{content:"⌕";position:absolute;left:.7rem;top:50%;transform:translateY(-50%);
  color:var(--fe-muted);font-size:1.1rem;pointer-events:none}
.alert{background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;padding:.7rem 1rem;border-radius:var(--radius-btn);
  margin-bottom:1rem;font-size:.9rem;display:flex;align-items:center;gap:.5rem}
.alert::before{content:"⚠";font-size:1rem}
.alert[hidden],.notice[hidden]{display:none}

/* Empty-state cells */
td.muted{color:var(--fe-muted)}
td[colspan]{padding:1.6rem .7rem;text-align:center;color:var(--fe-muted)}

/* Login */
.login-wrap{min-height:100vh;display:grid;place-items:center;background:var(--fe-grad);position:relative;overflow:hidden;padding:1rem}
.login-wrap::before,.login-wrap::after{content:"";position:absolute;border-radius:50%;filter:blur(8px);opacity:.18}
.login-wrap::before{width:420px;height:420px;background:var(--fe-accent);top:-140px;right:-120px}
.login-wrap::after{width:360px;height:360px;background:#5a7bff;bottom:-130px;left:-110px}
.login-card{position:relative;background:#fff;border-radius:16px;box-shadow:var(--shadow-lg);
  padding:2.25rem 2rem;width:380px;max-width:92vw;animation:pop-in .35s var(--ease)}
@keyframes pop-in{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
.login-card .brand{font-family:'Plus Jakarta Sans';font-weight:800;font-size:1.5rem;
  color:var(--fe-primary);margin-bottom:.15rem;letter-spacing:-.02em}
.login-card .btn{margin-top:.2rem}

/* ---- List search + filter bar ----
   Every control (search, selects, dates, buttons) is locked to --fb-h so the
   row reads as one straight line. Base inputs and .btn.sm each bring their own
   vertical padding and border width, so height + padding:0 is set explicitly
   rather than trying to match paddings by eye. */
.filterbar{--fb-h:2.4rem;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:0 0 1rem;
  padding:.7rem .8rem;background:#fff;border:1px solid var(--fe-border);border-radius:var(--radius);
  box-shadow:var(--shadow-sm)}
/* The global label rule carries margin:.7rem 0 .25rem — inside the bar that
   pushed the date labels 11.2px down and made their wrapper 15.2px too tall. */
.filterbar input,.filterbar select,.filterbar label{margin:0}
.filterbar .fb-search input,
.filterbar .fb-select,
.filterbar .fb-date input,
.filterbar .btn{height:var(--fb-h);padding-top:0;padding-bottom:0;font-size:.85rem}
.fb-search{flex:1 1 240px;min-width:180px}
.fb-search input{width:100%;padding-left:2.2rem;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7A8D' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat .7rem center}
.fb-search input::-webkit-search-cancel-button{cursor:pointer}
.fb-select{flex:0 1 auto;width:auto;min-width:9rem;padding-left:.6rem;padding-right:1.8rem}
/* From/To stay glued together so the range never splits across rows. Heights
   come from the inputs themselves — a fixed height here plus height:100% on the
   label made the label overflow its parent and sit 3.6px low. */
.fb-daterange{display:flex;align-items:center;gap:.4rem;flex:0 0 auto}
.fb-date{display:flex;align-items:center;gap:.35rem;font-size:.78rem;color:var(--fe-muted)}
.fb-date input{width:auto;padding-left:.5rem;padding-right:.5rem}
.filterbar .is-placeholder{color:#9aa8b8}
.fb-go{flex:0 0 auto}
.fb-count{margin-left:auto;white-space:nowrap}
td.empty-cell{color:var(--fe-muted);padding:1.6rem 1rem;text-align:center}
@media(max-width:720px){
  .fb-count{margin-left:0;width:100%}
  .fb-select{flex:1 1 45%}
  /* On a phone the From/To pair can't hold its natural width — let it take a
     row of its own and share it, rather than pushing the page sideways.
     min-width:0 is required: a flex item's automatic minimum size otherwise
     refuses to shrink below the two date inputs' min-content width. */
  .fb-daterange{flex:1 1 100%;min-width:0;flex-wrap:wrap}
  .fb-date{flex:1 1 45%;min-width:0}
  .fb-date input{width:100%;min-width:0}
}

/* Paperclip hints in list rows */
.clip-count{display:inline-flex;align-items:center;gap:.15rem;vertical-align:middle;margin-left:.3rem;
  color:var(--fe-muted);font-size:.75rem;font-weight:600}
.fname-hint{display:flex;align-items:center;gap:.3rem;margin-top:.15rem;color:var(--fe-muted);
  font-size:.72rem;font-weight:400;max-width:16rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fname-hint .clip-ico{width:12px;height:12px;flex:0 0 auto}

/* ---- Receiving a delivery: delivered / accepted / rejected per line ---- */
.recv-lines{display:flex;flex-direction:column;gap:.6rem}
.recv-line{border:1px solid var(--fe-border);border-radius:var(--radius);padding:.75rem .8rem;background:#fff}
.rl-head{display:flex;gap:.8rem;align-items:flex-start;justify-content:space-between;flex-wrap:wrap}
.rl-desc{font-weight:600;font-size:.9rem;flex:1 1 40%;min-width:180px}
.rl-po{flex:1 1 46%;min-width:220px;width:auto;font-size:.82rem;padding:.4rem .5rem}
.rl-qty{display:flex;align-items:flex-end;gap:.6rem;margin-top:.55rem;flex-wrap:wrap}
.rl-qty label{margin:0;font-size:.72rem;font-weight:600;color:var(--fe-muted);display:flex;flex-direction:column;gap:.15rem}
.rl-qty input{width:6.5rem;padding:.4rem .5rem;font-size:.9rem}
.rl-uom{padding-bottom:.5rem}
.rl-rejected{margin-left:auto;padding-bottom:.5rem;font-size:.8rem;color:var(--fe-danger)}
.rl-rejected strong{font-size:.95rem}
.rl-reject{display:flex;gap:.6rem;margin-top:.6rem;padding-top:.6rem;border-top:1px dashed var(--fe-border);flex-wrap:wrap}
.rl-reject[hidden]{display:none}
.rl-reject label{margin:0;font-size:.72rem;font-weight:600;color:var(--fe-muted);display:flex;flex-direction:column;gap:.15rem;flex:1 1 220px}
.rl-reject select,.rl-reject input{width:100%;padding:.4rem .5rem;font-size:.85rem}
.rl-warn{margin:.5rem 0 0;font-size:.8rem;padding:.4rem .6rem;border-radius:var(--radius-btn)}
.rl-warn[hidden]{display:none}
.rl-warn.is-warn{background:#fffbeb;color:#92400e;border:1px solid #fde68a}
.rl-warn.is-error{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca}
.over-card{border-color:#fde68a;background:#fffbeb}

/* ---- Settings > Users & project access ---- */
.users-table tr.is-off td{opacity:.55}
.users-table td{vertical-align:middle}
.user-form .row{margin-bottom:.2rem}
.role-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.5rem;margin:.3rem 0 .2rem}
.role-opt{display:block;margin:0;border:1.5px solid var(--fe-border);border-radius:var(--radius-btn);
  padding:.6rem .7rem;cursor:pointer;font-weight:400;transition:border-color .15s var(--ease),background .15s var(--ease)}
.role-opt:hover{border-color:#c7d2fe;background:#f7f9ff}
.role-opt.on{border-color:var(--fe-primary-2);background:#f7f9ff}
.role-opt input{width:auto;margin-right:.35rem}
.ro-name{font-weight:600;font-size:.88rem}
.ro-desc{display:block;color:var(--fe-muted);font-size:.75rem;line-height:1.35;margin-top:.15rem}
.proj-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:.35rem}
.proj-opt{display:flex;align-items:center;gap:.45rem;margin:0;border:1px solid var(--fe-border);
  border-radius:var(--radius-btn);padding:.45rem .6rem;cursor:pointer;font-weight:400;font-size:.85rem}
.proj-opt:hover{border-color:#c7d2fe;background:#f7f9ff}
.proj-opt input{width:auto;flex:0 0 auto}

/* ---- One-click demo logins ---- */
.demo-sep{display:flex;align-items:center;gap:.7rem;margin:1.3rem 0 .9rem;color:var(--fe-muted);font-size:.78rem}
.demo-sep::before,.demo-sep::after{content:"";flex:1;height:1px;background:var(--fe-border)}
.demo-grid{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
.demo-btn{display:flex;align-items:center;gap:.55rem;text-align:left;cursor:pointer;font:inherit;
  border:1px solid var(--fe-border);background:#fff;border-radius:var(--radius-btn);padding:.5rem .6rem;
  transition:border-color .15s var(--ease),background .15s var(--ease),transform .12s var(--ease)}
.demo-btn:hover{border-color:var(--fe-primary-2);background:#f7f9ff;transform:translateY(-1px)}
.demo-av{display:grid;place-items:center;flex:0 0 auto;width:1.9rem;height:1.9rem;border-radius:50%;
  background:var(--fe-grad);color:#fff;font-size:.7rem;font-weight:700;letter-spacing:.02em}
.demo-who{display:flex;flex-direction:column;line-height:1.2;min-width:0}
.demo-name{font-weight:600;font-size:.85rem;color:var(--fe-text)}
.demo-role{font-size:.72rem;color:var(--fe-muted)}
@media(max-width:380px){.demo-grid{grid-template-columns:1fr}}
.muted{color:var(--fe-muted)}.small{font-size:.85rem}

/* ---- Requisition builder (search + cart) ---- */
.rq-head{display:flex;gap:1rem;flex-wrap:wrap;align-items:flex-end;margin-bottom:1rem}
.rq-head .row{flex:1}
/* MR header — stacked rows of label-over-input fields, matching the app's .row>div pattern */
.mr-fields{display:flex;flex-direction:column;gap:.65rem}
.mr-fields .row{gap:1.25rem;row-gap:.2rem}
.mr-fields label{margin-top:0}
.mr-fields>.row>div>label{margin-bottom:.3rem}
/* Empty selects & date inputs show grey text, like input placeholders */
.mr-fields select.is-placeholder,
.mr-fields input.is-placeholder{color:#9aa8b8}
.mr-fields input.is-placeholder::-webkit-datetime-edit{color:#9aa8b8}
.rq-grid{display:grid;grid-template-columns:1.6fr 1fr;gap:1.25rem;align-items:start}
.rq-search input.big{font-size:1rem;padding:.85rem 1rem .85rem 2.4rem;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236B7A8D' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat .8rem center}
.chips{display:flex;gap:.4rem;flex-wrap:wrap;align-items:center;margin:.7rem 0}
.chip{border:1px solid var(--fe-border);background:#fff;border-radius:999px;padding:.2rem .7rem;font-size:.82rem;cursor:pointer;color:var(--fe-text);transition:all .15s var(--ease)}
.chip:hover{border-color:var(--fe-primary-2);color:var(--fe-primary-2);background:#f7f9ff}
.chip.active{background:var(--fe-primary-2);border-color:var(--fe-primary-2);color:#fff}
.chip.count{border:none;background:none;color:var(--fe-muted);cursor:default}
.item-list{max-height:60vh;overflow:auto;display:flex;flex-direction:column;gap:.6rem;padding-right:.2rem}
.item-card{display:flex;align-items:center;justify-content:space-between;gap:1rem;border:1px solid var(--fe-border);border-radius:var(--radius);padding:.85rem 1rem;background:#fff;transition:box-shadow .15s var(--ease),border-color .15s var(--ease),transform .12s var(--ease)}
.item-card:hover{box-shadow:var(--shadow-md);border-color:#c7d2fe;transform:translateY(-1px)}
.item-main .nm{font-weight:600}
.item-main .sub{color:var(--fe-muted);font-size:.82rem;margin-top:.15rem}
.item-price{display:flex;align-items:baseline;justify-content:flex-end;gap:.3rem;white-space:nowrap;min-width:118px}
.item-price .amt{font-weight:700}
.item-price .amt.none{font-weight:500;color:var(--fe-muted);font-size:.9rem}
.item-price .per{color:var(--fe-muted);font-size:.78rem;font-weight:400}
.item-add{white-space:nowrap}
.badge.code{background:#eef2ff;color:var(--fe-primary-2);font-family:ui-monospace,monospace}
.pill-added{background:#dcfce7;color:#15803d;border:1px solid #bbf7d0;border-radius:var(--radius-btn);padding:.4rem .9rem;font-weight:600;font-size:.85rem}
/* cart */
.cart{position:sticky;top:1rem;border:1px solid var(--fe-border);border-radius:var(--radius);background:#fff;box-shadow:var(--shadow-sm);overflow:hidden}
.cart-h{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.1rem;border-bottom:1px solid var(--fe-border);background:linear-gradient(#fff,#fafbff)}
.cart-h h3{margin:0}
.cart-body{max-height:52vh;overflow:auto;padding:.6rem}
.cart-line{border:1px solid var(--fe-border);border-radius:10px;padding:.7rem;margin:.4rem;position:relative;transition:border-color .15s var(--ease)}
.cart-line:hover{border-color:#c7d2fe}
.cart-line .x{position:absolute;top:.5rem;right:.6rem;color:var(--fe-muted);cursor:pointer;border:none;background:none;font-size:1.1rem;line-height:1;border-radius:6px;width:22px;height:22px;transition:all .15s var(--ease)}
.cart-line .x:hover{background:#fee2e2;color:#b91c1c}
.cart-line .nm{font-weight:600;padding-right:1.2rem}
.cart-line .rowline{display:flex;align-items:center;justify-content:space-between;margin-top:.5rem}
.stepper{display:inline-flex;align-items:center;border:1px solid var(--fe-border);border-radius:var(--radius-btn);overflow:hidden}
.stepper button{border:none;background:#f4f6fb;width:30px;height:32px;font-size:1rem;cursor:pointer;color:var(--fe-primary);transition:background .12s var(--ease)}
.stepper button:hover{background:#e6ebf7}
.stepper input{width:52px;text-align:center;border:none;border-left:1px solid var(--fe-border);border-right:1px solid var(--fe-border);height:32px;padding:0}
.cart-foot{padding:1rem 1.1rem;border-top:1px solid var(--fe-border)}
.cart-total{display:flex;justify-content:space-between;align-items:center;margin-bottom:.8rem}
.cart-total .v{font-family:'Plus Jakarta Sans';font-size:1.5rem;font-weight:800;color:var(--fe-primary)}
.cart-empty{color:var(--fe-muted);text-align:center;padding:2rem 1rem;font-size:.9rem}

/* Top-bar role pill + nav badge */
.topbar .who{display:flex;align-items:center;gap:.7rem}
.who-name{font-weight:600;color:var(--fe-text)}
.signout{color:var(--fe-muted);font-size:.85rem}
.role-pill{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;
  padding:.2rem .6rem;border-radius:999px;line-height:1.5}
.role-pill.admin{background:linear-gradient(135deg,#FF6B35,#ff8f5e);color:#fff;box-shadow:0 2px 8px rgba(255,107,53,.3)}
.role-pill.staff{background:#eef2ff;color:var(--fe-primary-2)}
.nav-badge{background:var(--fe-accent);color:#fff;font-size:.68rem;font-weight:800;min-width:18px;height:18px;
  padding:0 5px;border-radius:999px;display:inline-grid;place-items:center;margin-left:auto;
  box-shadow:0 1px 4px rgba(0,0,0,.25)}
.sidebar nav a{position:relative}

/* Hero */
.hero{position:relative;overflow:hidden;border-radius:18px;background:var(--fe-grad);color:#fff;
  padding:2rem 2.2rem;margin-bottom:1.4rem;box-shadow:var(--shadow-lg);animation:fade-in .35s var(--ease)}
.hero-txt{position:relative;z-index:2;max-width:640px}
.hero-kicker{font-size:.72rem;text-transform:uppercase;letter-spacing:.14em;font-weight:700;color:#bcd0ff;margin-bottom:.4rem}
.hero h1{color:#fff;font-size:2rem;margin:0 0 .3rem}
.hero p{color:#d7e0ff;margin:0 0 1.2rem;font-size:.98rem}
.hero-cta{display:flex;gap:.7rem;flex-wrap:wrap}
.btn.secondary.on-dark{background:rgba(255,255,255,.12);color:#fff;border-color:rgba(255,255,255,.4);backdrop-filter:blur(4px)}
.btn.secondary.on-dark:hover{background:rgba(255,255,255,.2);color:#fff;border-color:#fff}
.hero-orb{position:absolute;right:-60px;top:-60px;width:320px;height:320px;border-radius:50%;
  background:radial-gradient(circle at 30% 30%,rgba(255,107,53,.55),rgba(255,107,53,0) 70%);z-index:1}
.hero::after{content:"";position:absolute;right:80px;bottom:-90px;width:240px;height:240px;border-radius:50%;
  background:radial-gradient(circle,rgba(90,123,255,.5),rgba(90,123,255,0) 70%);z-index:1}

/* Dashboard stat grid */
.stat-grid{grid-template-columns:repeat(3,1fr)}
.stat{display:block}
.stat-ic{position:absolute;right:1rem;top:.9rem;opacity:.22;color:var(--fe-primary);line-height:0}
.stat-ic .stat-ico{width:30px;height:30px}
.stat.accent-pending .stat-ic{color:#F59E0B}
.stat.accent-po .stat-ic{color:#22C55E}
.stat.accent-cat .stat-ic{color:#8b5cf6}
.stat.accent-req::before,.stat.accent-pending::before,.stat.accent-po::before,.stat.accent-cat::before{opacity:1}
.stat.accent-pending::before{background:linear-gradient(180deg,#F59E0B,#f6ad3d)}
.stat.accent-po::before{background:linear-gradient(180deg,#22C55E,#4ade80)}
.stat.accent-cat::before{background:linear-gradient(180deg,#8b5cf6,#a78bfa)}
.stat.accent-pending .num{color:#b45309}

/* Awaiting-approval strip (dashboard) */
.approve-strip{border:1px solid #fde68a;background:linear-gradient(#fffdf5,#fff)}
.as-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:.6rem}
.as-list{display:flex;flex-direction:column;gap:.4rem}
.as-item{display:flex;align-items:center;gap:.6rem;padding:.6rem .8rem;border:1px solid var(--fe-border);
  border-radius:10px;background:#fff;transition:all .15s var(--ease)}
.as-item:hover{border-color:#fcd34d;box-shadow:var(--shadow-sm);text-decoration:none;transform:translateX(2px)}
.as-mr{font-weight:700;color:var(--fe-primary)}

/* ---- Priority dashboard ---- */
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;margin-top:1.25rem}
.stat.kpi{padding:1rem 1.1rem}
.stat.kpi .num{font-size:2rem}
.stat.kpi .sub{font-size:.76rem;color:var(--fe-muted);margin-top:.35rem;font-weight:500}
.stat.accent-urgent::before{background:linear-gradient(180deg,#dc2626,#ef4444);opacity:1}
.stat.accent-urgent .num{color:#dc2626}
.stat.accent-danger::before{background:linear-gradient(180deg,#dc2626,#f87171);opacity:1}
.stat.accent-danger .num{color:#b91c1c}
.stat.accent-ok::before{background:linear-gradient(180deg,#22C55E,#4ade80);opacity:1}
.stat.accent-ok .num{color:#15803d}
.stat.accent-blue::before{background:linear-gradient(180deg,#3b82f6,#60a5fa);opacity:1}
.stat.accent-blue .num{color:#2563eb}

.dash-grid{display:grid;grid-template-columns:1.4fr 1fr;gap:1.25rem;align-items:start;margin-top:1.25rem}
.dash-col{display:flex;flex-direction:column;gap:1.25rem}
.dash-card h2{margin:0;font-size:1.05rem}
.dash-sec-h{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:.2rem}
.dash-empty{color:var(--fe-muted);font-size:.9rem;padding:.9rem .2rem}

.pri-list{display:flex;flex-direction:column;gap:.5rem;margin-top:.6rem}
.pri-item{display:grid;grid-template-columns:auto 1fr auto;gap:.3rem 1rem;align-items:center;
  padding:.65rem .85rem;border:1px solid var(--fe-border);border-left-width:4px;border-radius:12px;
  background:#fff;transition:all .15s var(--ease)}
.pri-item:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);text-decoration:none;border-color:#c7d2fe}
.pri-item.u1{border-left-color:#dc2626}
.pri-item.u2{border-left-color:#f97316}
.pri-item.u3{border-left-color:#f59e0b}
.pri-item.u4{border-left-color:#94a3b8}
.pri-item.u5{border-left-color:#cbd5e1}
.pri-mr{font-weight:700;color:var(--fe-primary);font-family:'Plus Jakarta Sans',sans-serif}

/* ---- PO fulfilment / outstanding summary ---- */
.po-fulfil{display:grid;grid-template-columns:repeat(4,1fr);gap:.8rem;margin:.2rem 0 .8rem}
.po-fulfil>div{display:flex;flex-direction:column;gap:.1rem;padding:.6rem .8rem;border:1px solid var(--fe-border);border-radius:12px;background:#fbfdff}
.po-fulfil .fu-num{font-family:'Plus Jakarta Sans',sans-serif;font-size:1.5rem;font-weight:800;color:var(--fe-primary);line-height:1.1}
.po-fulfil .fu-num.ok{color:#15803d}
.po-fulfil .fu-num.warn{color:#b45309}
.po-fulfil .fu-lbl{font-size:.76rem;color:var(--fe-muted)}
.po-bar{height:8px;border-radius:999px;background:#eef2f7;overflow:hidden}
.po-bar>span{display:block;height:100%;background:linear-gradient(90deg,#22C55E,#4ade80);border-radius:999px;transition:width .3s var(--ease)}
@media(max-width:640px){.po-fulfil{grid-template-columns:repeat(2,1fr)}}
.pri-meta{display:flex;flex-wrap:wrap;gap:.3rem .55rem;align-items:center;min-width:0}
.pri-right{display:flex;flex-direction:column;align-items:flex-end;gap:.2rem;text-align:right;white-space:nowrap}
@media(max-width:1050px){.kpi-grid{grid-template-columns:repeat(2,1fr)}.dash-grid{grid-template-columns:1fr}}
@media(max-width:560px){.pri-item{grid-template-columns:1fr auto}.pri-item .pri-mr{grid-column:1/-1}}

/* Approvals page — card grid */
.approval-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:1rem}
.approval-card{background:#fff;border:1px solid var(--fe-border);border-radius:14px;padding:1.1rem 1.2rem;
  box-shadow:var(--shadow-sm);border-left:4px solid var(--fe-accent);
  transition:transform .16s var(--ease),box-shadow .16s var(--ease)}
.approval-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}
.ac-top{display:flex;justify-content:space-between;align-items:flex-start;gap:.6rem}
.ac-mr{font-family:'Plus Jakarta Sans';font-weight:800;font-size:1.15rem;color:var(--fe-primary)}
.ac-proj{margin-top:.25rem;font-size:.9rem}
.ac-lines{font-size:.75rem;color:var(--fe-muted);background:#f1f5f9;border-radius:999px;padding:.15rem .6rem;white-space:nowrap}
.ac-meta{display:flex;flex-wrap:wrap;gap:.9rem;margin:.8rem 0;color:var(--fe-muted);font-size:.85rem}
.ac-actions{display:flex;gap:.5rem;justify-content:flex-end;border-top:1px solid var(--fe-border);padding-top:.8rem}

/* Empty hero */
.empty-hero{text-align:center;padding:3rem 1.5rem}
.empty-emoji{font-size:2.6rem;color:var(--fe-success);margin-bottom:.3rem}

/* Buttons: ghost danger */
.btn.ghost{background:#fff;color:var(--fe-muted);border-color:var(--fe-border);box-shadow:none}
.btn.ghost:hover{background:#f7f9ff;border-color:#c7d2e6;color:var(--fe-primary);filter:none;box-shadow:none}
.btn.ghost-danger{background:#fff;color:var(--fe-danger);border-color:#fecaca;box-shadow:none}
.btn.ghost-danger:hover{background:#fef2f2;border-color:var(--fe-danger);color:#b91c1c;filter:none;box-shadow:none}
.row-actions{display:flex;gap:.4rem;white-space:nowrap}

/* Notice banner (success/info) */
.notice{background:#ecfdf5;border:1px solid #a7f3d0;color:#047857;padding:.7rem 1rem;border-radius:var(--radius-btn);
  margin-bottom:1rem;font-size:.9rem;display:flex;align-items:center;gap:.5rem;animation:fade-in .3s var(--ease)}
.notice::before{content:"✓";font-weight:800}
.notice.err{background:#fef2f2;border-color:#fecaca;color:#b91c1c}
.notice.err::before{content:"⚠"}

/* Requisition builder — add-row */
.add-row{display:flex;gap:.6rem;flex-wrap:wrap;margin-top:.8rem}

/* Modal */
.modal-overlay{position:fixed;inset:0;background:rgba(16,24,52,.55);backdrop-filter:blur(3px);
  display:grid;place-items:center;z-index:100;padding:1rem;animation:fade-in .18s var(--ease)}
.modal-overlay[hidden]{display:none}
.modal.np-modal{width:640px}
.modal{background:#fff;border-radius:16px;box-shadow:var(--shadow-lg);width:520px;max-width:96vw;
  max-height:92vh;overflow:auto;animation:pop-in .22s var(--ease)}
.modal-h{display:flex;justify-content:space-between;align-items:center;padding:1.1rem 1.3rem;
  border-bottom:1px solid var(--fe-border);background:linear-gradient(#fff,#fafbff);position:sticky;top:0}
.modal-h h3{margin:0}
.modal-x{border:none;background:none;font-size:1.5rem;line-height:1;color:var(--fe-muted);cursor:pointer;
  width:32px;height:32px;border-radius:8px;transition:all .15s var(--ease)}
.modal-x:hover{background:#fee2e2;color:#b91c1c}
.modal-b{padding:1.1rem 1.3rem}
.modal-f{display:flex;justify-content:flex-end;gap:.6rem;padding:1rem 1.3rem;border-top:1px solid var(--fe-border);
  position:sticky;bottom:0;background:#fff}

/* Settings — Xero card */
.xero-card{max-width:760px}
/* Settings tabs — Xero / WhatsApp / Users. These were side-by-side columns, but
   the cards' min-content width (wide tables, the webhook URL) blew the grid out
   past the viewport and pushed WhatsApp off-screen. One pane at a time can't. */
.settings-tabs{display:flex;gap:.4rem;border-bottom:1px solid var(--fe-border);margin:0 0 1.2rem;flex-wrap:wrap}
.stab{display:flex;align-items:center;gap:.45rem;background:none;border:none;border-bottom:2px solid transparent;
  padding:.6rem .9rem;font:inherit;font-weight:600;color:var(--fe-muted);cursor:pointer;transition:color .12s var(--ease)}
.stab:hover{color:var(--fe-primary-2)}
.stab.on{color:var(--fe-primary);border-bottom-color:var(--fe-primary-2)}
.conn-dot{width:.5rem;height:.5rem;border-radius:999px;flex-shrink:0}
.conn-dot.on{background:#16a34a}
.conn-dot.off{background:#cbd5e1}
.settings-panes{min-width:0}
.settings-panes .xero-card{max-width:none;margin:0}
.settings-panes table{width:100%}
.xero-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap;
  padding-bottom:1rem;border-bottom:1px solid var(--fe-border);margin-bottom:1rem}
.xero-title{display:flex;gap:.8rem;align-items:center}
.xero-logo{width:42px;height:42px;border-radius:10px;flex-shrink:0;display:grid;place-items:center;
  background:linear-gradient(135deg,#13B5EA,#0d8fbf);color:#fff;font-weight:900;font-size:1.3rem;
  font-family:'Plus Jakarta Sans';box-shadow:0 3px 10px rgba(19,181,234,.35)}
.conn-pill{font-size:.8rem;font-weight:700;padding:.3rem .7rem;border-radius:999px;white-space:nowrap}
.conn-pill.on{background:#dcfce7;color:#15803d}
.conn-pill.off{background:#f1f5f9;color:var(--fe-muted)}
.xero-connected{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;
  background:#f0fdf4;border:1px solid #bbf7d0;border-radius:10px;padding:.9rem 1.1rem;margin-bottom:1.1rem}
.xero-conn-actions{display:flex;gap:.5rem;align-items:center}
.xero-conn-actions form{display:inline}
.xero-form label{margin-top:1rem}
.switch-row{display:flex;align-items:center;gap:.6rem;margin:.2rem 0 .4rem}
.switch-row input{width:auto;margin:0}
.switch-row span{font-weight:600}
/* min-width:0 so a long webhook URL wraps instead of widening the whole page. */
.copy-field{display:flex;gap:.5rem;align-items:center;min-width:0}
.copy-field input{font-family:ui-monospace,monospace;font-size:.85rem;background:#f8fafc;min-width:0;flex:1}
.xero-actions{display:flex;gap:.7rem;align-items:center;margin-top:1.3rem;flex-wrap:wrap}
.xero-help{margin-top:1.2rem;border-top:1px solid var(--fe-border);padding-top:.9rem}
.xero-help summary{cursor:pointer;font-weight:600;color:var(--fe-primary-2)}
.xero-help ol{margin:.6rem 0 0;padding-left:1.2rem;line-height:1.9}
.xero-logo.wa{background:linear-gradient(135deg,#25D366,#128C7E);box-shadow:0 3px 10px rgba(37,211,102,.35)}
.senders{margin-top:1.4rem;border-top:1px solid var(--fe-border);padding-top:.4rem}
.sender-add{display:flex;gap:.6rem;flex-wrap:wrap;margin-top:.9rem}
.sender-add input{flex:1;min-width:160px;width:auto}
.sender-add button{flex-shrink:0}

/* Responsive */
@media(max-width:1050px){.stat-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:900px){.rq-grid{grid-template-columns:1fr}.cart{position:static}}

/* ---- MR step tabs: 1. Items / 2. Quotations ---- */
.steps{display:flex;gap:.4rem;border-bottom:1px solid var(--fe-border);margin:0 0 1.1rem}
.step{display:flex;align-items:center;gap:.45rem;background:none;border:none;border-bottom:2px solid transparent;
  padding:.6rem .9rem;margin-bottom:-1px;font:inherit;font-weight:600;font-size:.92rem;color:var(--fe-muted);
  cursor:pointer;transition:color .15s var(--ease),border-color .15s var(--ease)}
.step:hover{color:var(--fe-primary-2)}
.step.active{color:var(--fe-primary);border-bottom-color:var(--fe-primary-2)}
.step-n{display:grid;place-items:center;width:1.35rem;height:1.35rem;border-radius:999px;
  background:var(--fe-light);color:var(--fe-muted);font-size:.76rem;font-weight:700}
.step.active .step-n{background:var(--fe-primary-2);color:#fff}
.quote-actions{display:flex;justify-content:space-between;gap:.8rem;align-items:center}

/* ---- Quotation dropzone ---- */
.dropzone{display:flex;flex-direction:column;align-items:center;gap:.35rem;text-align:center;cursor:pointer;
  border:1.5px dashed var(--fe-border);border-radius:var(--radius);padding:1.8rem 1rem;background:#fbfcfe;
  transition:border-color .15s var(--ease),background .15s var(--ease)}
.dropzone:hover,.dropzone.over{border-color:var(--fe-primary-2);background:#f7f9ff}
.dz-clip{color:var(--fe-primary-2);display:block}
.dz-clip .clip-ico{width:26px;height:26px}
.dz-main{font-weight:600}
.dz-link{color:var(--fe-primary-2);text-decoration:underline}
.dz-sub{color:var(--fe-muted);font-size:.82rem}

/* ---- Attached-file rows (MR quotations, DO scan) ---- */
.attach-list{list-style:none;margin:.6rem 0 0;padding:0;display:flex;flex-direction:column;gap:.4rem}
.attach-row{display:flex;align-items:center;gap:.6rem;border:1px solid var(--fe-border);border-radius:var(--radius-btn);
  padding:.55rem .7rem;background:#fff}
.attach-row .clip{display:flex;color:var(--fe-muted);flex:0 0 auto}
/* Thumbnail for image attachments, type pill for everything else */
.ft-thumb{flex:0 0 auto;width:2.2rem;height:2.2rem;object-fit:cover;border-radius:6px;border:1px solid var(--fe-border);background:var(--fe-light)}
.ft-pill{display:grid;place-items:center;flex:0 0 auto;width:2.2rem;height:2.2rem;border-radius:6px;
  background:#eef2ff;color:var(--fe-primary-2);font-size:.6rem;font-weight:700;letter-spacing:.02em}
.dropzone.has-file{border-style:solid;border-color:var(--fe-border);padding:1.1rem 1rem;background:#fff}
.clip-ico{width:16px;height:16px}
.attach-row .fn{font-weight:600;font-size:.9rem;word-break:break-all;flex:1 1 auto}
.attach-row .sz{flex:0 0 auto;white-space:nowrap}
.attach-row .x{border:none;background:none;color:var(--fe-muted);font-size:1.1rem;line-height:1;cursor:pointer;
  padding:0 .2rem;border-radius:4px;flex:0 0 auto}
.attach-row .x:hover{color:var(--fe-danger);background:#fef2f2}
@media(max-width:720px){
  .sidebar{width:64px}
  .sidebar .brand span:not(.logo),.sidebar nav a span,.sidebar .tag{display:none}
  .sidebar nav a{justify-content:center;padding:.7rem 0}
  .sidebar nav a .nav-ico{width:22px;height:22px}
  .grid.cols-3,.stat-grid{grid-template-columns:1fr}
  .hero{padding:1.5rem 1.3rem}.hero h1{font-size:1.6rem}
  .content{padding:1.25rem 1rem}
  .toolbar{align-items:stretch}
}
@media(prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}

/* ---- Cute global loading overlay (the little Starship rocket) ------------ */
.ship-loader{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;
  background:rgba(244,246,251,.72);backdrop-filter:blur(6px) saturate(1.1);-webkit-backdrop-filter:blur(6px) saturate(1.1)}
.ship-loader.on{display:flex;animation:sl-fade .22s var(--ease)}
@keyframes sl-fade{from{opacity:0}to{opacity:1}}
.sl-card{display:flex;flex-direction:column;align-items:center;gap:.9rem;padding:2rem 2.4rem;
  background:#fff;border:1px solid var(--fe-border);border-radius:22px;
  box-shadow:0 20px 55px rgba(26,46,111,.20);min-width:min(88vw,320px);text-align:center}
.sl-stage{position:relative;width:88px;height:64px;display:flex;align-items:flex-end;justify-content:center}
.sl-rocket{font-size:2.9rem;line-height:1;filter:drop-shadow(0 7px 9px rgba(255,107,53,.4));
  animation:sl-bob 1.15s ease-in-out infinite}
@keyframes sl-bob{0%,100%{transform:translateY(2px) rotate(-8deg)}50%{transform:translateY(-12px) rotate(8deg)}}
.sl-thrust{display:flex;gap:.42rem;height:.55rem;margin-top:.15rem}
.sl-thrust i{width:.5rem;height:.5rem;border-radius:50%;background:var(--fe-accent);
  animation:sl-pop 1.15s ease-in-out infinite}
.sl-thrust i:nth-child(2){animation-delay:.16s}
.sl-thrust i:nth-child(3){animation-delay:.32s}
@keyframes sl-pop{0%,100%{transform:scale(.55);opacity:.35}50%{transform:scale(1);opacity:.95}}
.sl-msg{font-family:'Plus Jakarta Sans',sans-serif;font-weight:700;color:var(--fe-primary);
  font-size:1.02rem;max-width:24ch;min-height:2.5em;display:flex;align-items:center}
.sl-msg span{animation:sl-msg-in .32s var(--ease)}
.sl-sub{color:var(--fe-muted);font-size:.78rem;margin-top:-.35rem}
@keyframes sl-msg-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}

/* Live dashboard — heartbeat pulse, pipeline strip, live refresh ---------- */
.live-pill{position:absolute;top:1.1rem;right:1.25rem;z-index:2;display:inline-flex;align-items:center;gap:.45rem;
  font-size:.7rem;font-weight:700;letter-spacing:.08em;color:#9fe8b8;background:rgba(34,197,94,.14);
  border:1px solid rgba(34,197,94,.4);padding:.28rem .7rem;border-radius:999px;white-space:nowrap}
.live-pill i,.live-dot{width:8px;height:8px;border-radius:50%;background:#22C55E;display:inline-block;
  animation:live-blink 1.5s infinite}
@keyframes live-blink{0%,100%{box-shadow:0 0 0 0 rgba(34,197,94,.5);opacity:1}50%{box-shadow:0 0 0 6px rgba(34,197,94,0);opacity:.7}}

.pulse-card{margin-top:1.25rem;margin-bottom:0}
.pulse-note{display:inline-flex;align-items:center;gap:.5rem;color:var(--fe-muted);font-size:.78rem}
.pipeline{display:flex;align-items:stretch;gap:.15rem;margin-top:.9rem;overflow-x:auto;padding-bottom:.25rem}
.pl-stage{flex:1;min-width:108px;text-align:center;padding:.8rem .4rem .7rem;border-radius:12px;
  border:1px solid transparent;transition:background .15s var(--ease),border-color .15s var(--ease),transform .15s var(--ease)}
.pl-stage:hover{background:#f7f9ff;border-color:var(--fe-border);text-decoration:none;transform:translateY(-2px)}
.pl-ecg{display:block;height:20px;margin:0 auto .3rem;width:64px}
.pl-ecg svg{width:100%;height:100%;overflow:visible}
.pl-ecg polyline{fill:none;stroke:var(--fe-primary-2);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:120;stroke-dashoffset:120;animation:ecg-draw 2.2s linear infinite}
@keyframes ecg-draw{0%{stroke-dashoffset:120;opacity:0}8%{opacity:1}55%{stroke-dashoffset:0;opacity:1}80%{opacity:.25}100%{stroke-dashoffset:0;opacity:0}}
.pl-stage.good .pl-ecg polyline{stroke:#22C55E}
.pl-stage.bad .pl-ecg polyline{stroke:#EF4444;animation-duration:1.2s}
.pl-stage.calm .pl-ecg polyline{stroke:#cbd5e1;animation-duration:4s}
.pl-num{display:block;font-family:'Plus Jakarta Sans';font-weight:800;font-size:1.5rem;color:var(--fe-primary);line-height:1.15}
.pl-stage.bad .pl-num{color:#b91c1c}
.pl-stage.calm .pl-num{color:#94a3b8}
.pl-lbl{display:block;font-size:.78rem;font-weight:600;color:var(--fe-text)}
.pl-sub{display:block;font-size:.66rem;color:var(--fe-muted)}
.pl-link{position:relative;flex:0 0 34px;align-self:center;height:2px;margin-top:-1.4rem;
  background-image:linear-gradient(90deg,#cbd5e1 55%,transparent 0);background-size:7px 2px}
.pl-link i{position:absolute;top:-2.5px;left:0;width:7px;height:7px;border-radius:50%;background:var(--fe-accent);
  box-shadow:0 0 6px rgba(255,107,53,.7);animation:pl-travel 2.4s linear infinite}
@keyframes pl-travel{0%{left:-4px;opacity:0}12%{opacity:1}88%{opacity:1}100%{left:calc(100% - 3px);opacity:0}}
.pl-link:nth-of-type(4) i{animation-delay:.4s}.pl-link:nth-of-type(8) i{animation-delay:.8s}
.pl-link:nth-of-type(12) i{animation-delay:1.2s}.pl-link:nth-of-type(16) i{animation-delay:1.6s}
.pl-link:nth-of-type(20) i{animation-delay:2s}

.stat.kpi.beat{animation:kpi-beat 1.6s var(--ease) infinite}
@keyframes kpi-beat{0%,100%{box-shadow:var(--shadow-sm)}50%{box-shadow:0 0 0 5px rgba(220,38,38,.10),var(--shadow-sm)}}
.num-flash{animation:num-flash .8s var(--ease)}
@keyframes num-flash{0%{color:var(--fe-accent);text-shadow:0 0 12px rgba(255,107,53,.45)}100%{text-shadow:none}}

@media (prefers-reduced-motion:reduce){
  .live-pill i,.live-dot,.pl-ecg polyline,.pl-link i,.stat.kpi.beat{animation:none}
  .pl-ecg polyline{stroke-dashoffset:0}
}
