:root{--bg:#f4f7fb;--ink:#172033;--muted:#6c7585;--brand:#0f766e;--brand2:#2563eb;--line:#e2e8f0;--sidebar:#111827}body{background:var(--bg);color:var(--ink);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.app-shell{min-height:100vh;display:flex}.sidebar{width:268px;background:var(--sidebar);color:#fff;position:fixed;inset:0 auto 0 0;padding:20px 16px;z-index:10;height:100vh;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#475569 #111827}.sidebar::-webkit-scrollbar{width:8px}.sidebar::-webkit-scrollbar-track{background:#111827}.sidebar::-webkit-scrollbar-thumb{background:#475569;border-radius:999px}.brand{display:flex;gap:12px;color:#fff;text-decoration:none;align-items:center;position:sticky;top:-20px;background:var(--sidebar);padding:0 0 14px;z-index:1}.brand small{display:block;color:#a7b0c2;font-size:11px;line-height:1.2}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:8px;background:linear-gradient(135deg,var(--brand),var(--brand2));font-weight:800}.sidebar .nav-link{color:#d6dbe6;border-radius:8px;padding:10px 12px}.sidebar .nav-link:hover,.sidebar .nav-link.active{background:#1f2937;color:#fff}.topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;padding:0 24px;margin-left:268px;position:sticky;top:0;z-index:5}.content{margin-left:268px;padding:24px;width:calc(100% - 268px)}.app-footer{margin-left:268px;padding:16px 24px;color:var(--muted);font-size:13px}.stat-card{background:#fff;border:1px solid var(--line);border-radius:8px;padding:18px;box-shadow:0 8px 20px rgba(15,23,42,.04)}.stat-card .icon{width:42px;height:42px;border-radius:8px;display:grid;place-items:center;color:#fff;background:var(--brand)}.panel{background:#fff;border:1px solid var(--line);border-radius:8px;padding:20px}.table> :not(caption)>*>*{vertical-align:middle}.badge-soft{background:#e0f2fe;color:#075985}.pos-grid{display:grid;grid-template-columns:1fr 360px;gap:20px}.form-control,.form-select,.btn{border-radius:8px}@media(max-width:991px){.sidebar{transform:translateX(-100%);transition:.2s;box-shadow:20px 0 40px rgba(15,23,42,.22)}.sidebar.open{transform:translateX(0)}.topbar,.content,.app-footer{margin-left:0;width:auto}.pos-grid{grid-template-columns:1fr}}.ai-chat-panel{min-height:680px;display:flex;flex-direction:column}.ai-messages{height:430px;overflow-y:auto;background:#f8fafc;border:1px solid var(--line);border-radius:8px;padding:14px}.ai-message{max-width:82%;padding:11px 13px;border-radius:8px;margin-bottom:10px;white-space:pre-wrap;line-height:1.45}.ai-message.user{margin-left:auto;background:#0f766e;color:#fff}.ai-message.assistant{background:#fff;border:1px solid var(--line)}.ai-message.error{background:#fee2e2;border:1px solid #fecaca;color:#991b1b}.ai-suggestions{display:flex;flex-wrap:wrap;gap:8px}.ai-conversations{max-height:360px;overflow:auto}.ai-form textarea{resize:none}@media(max-width:991px){.ai-messages{height:360px}.ai-message{max-width:96%}}.report-card{display:flex;gap:14px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:8px;padding:16px;text-decoration:none;color:var(--ink);height:100%;box-shadow:0 8px 20px rgba(15,23,42,.04)}.report-card:hover{border-color:#94a3b8;transform:translateY(-1px)}.report-card i{width:38px;height:38px;border-radius:8px;background:#ecfeff;color:#0f766e;display:grid;place-items:center;font-size:20px}.report-card small{display:block;color:var(--muted);margin-top:4px;line-height:1.35}
.customer-portal-body{background:#f6f8fb;color:#172033}.portal-topbar{position:sticky;top:0;z-index:20;background:#fff;border-bottom:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px clamp(16px,4vw,48px)}.portal-brand{display:flex;align-items:center;gap:12px;color:#172033;text-decoration:none}.portal-brand img,.portal-brand span{width:42px;height:42px;border-radius:8px;object-fit:cover;background:linear-gradient(135deg,var(--portal-primary),var(--portal-accent));display:grid;place-items:center;color:#fff;font-weight:800}.portal-nav{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.portal-nav a{color:#475569;text-decoration:none;padding:8px 10px;border-radius:8px;font-size:14px}.portal-nav a:hover,.portal-pill-link{background:#eef6ff;color:var(--portal-primary)!important}.portal-main{width:100%;max-width:none;padding:24px clamp(16px,4vw,48px) 82px}.portal-hero{background:linear-gradient(135deg,var(--portal-primary),var(--portal-accent));color:#fff;border-radius:8px;padding:26px;display:flex;justify-content:space-between;gap:20px;align-items:flex-end}.portal-hero p{color:rgba(255,255,255,.82)}.portal-card{background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:18px;box-shadow:0 8px 20px rgba(15,23,42,.04);height:100%}.portal-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.portal-kpi{background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:16px}.portal-kpi span{display:block;color:#64748b;font-size:13px}.portal-kpi strong{display:block;font-size:24px;margin-top:6px}.portal-grid{display:grid;grid-template-columns:2fr 1fr;gap:16px}.portal-list{display:grid;gap:10px}.portal-list-item{display:flex;justify-content:space-between;gap:14px;align-items:center;border:1px solid #e2e8f0;border-radius:8px;padding:12px;text-decoration:none;color:#172033;background:#fff}.portal-product-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.portal-product{background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:14px;display:flex;flex-direction:column;gap:8px;min-height:170px}.portal-product .placeholder{height:76px;border-radius:8px;background:#eef2f7;display:grid;place-items:center;color:#64748b}.portal-auth{max-width:520px;margin:32px auto}.portal-auth .portal-card{padding:26px}.portal-timeline{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.portal-step{border-top:4px solid #cbd5e1;padding-top:8px;font-size:13px;color:#64748b}.portal-step.active{border-color:var(--portal-primary);color:#172033;font-weight:700}.portal-bottom-nav{display:none}.portal-footer{padding:20px clamp(16px,4vw,48px);color:#64748b;display:flex;gap:14px;flex-wrap:wrap}.portal-footer a{color:#64748b}.portal-ai-box{height:360px;overflow:auto;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:14px}.portal-ai-msg{max-width:84%;padding:10px 12px;border-radius:8px;margin-bottom:10px;white-space:pre-wrap}.portal-ai-msg.customer{margin-left:auto;background:var(--portal-primary);color:#fff}.portal-ai-msg.assistant{background:#fff;border:1px solid #e2e8f0}@media(max-width:1100px){.portal-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.portal-grid{grid-template-columns:1fr}}@media(max-width:720px){.portal-topbar{align-items:flex-start}.portal-nav{display:none}.portal-main{padding:16px 14px 96px}.portal-hero{display:block}.portal-kpis,.portal-product-grid{grid-template-columns:1fr}.portal-timeline{grid-template-columns:1fr}.portal-bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:30;background:#fff;border-top:1px solid #e2e8f0;display:grid;grid-auto-flow:column;grid-auto-columns:1fr}.portal-bottom-nav a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 4px;color:#475569;text-decoration:none;font-size:11px}.portal-bottom-nav i{font-size:18px}.portal-footer{padding-bottom:84px}}

/* Customer portal glassmorphism refresh */
.customer-portal-body{
  min-height:100vh;
  background:
    radial-gradient(circle at 8% 8%, color-mix(in srgb,var(--portal-primary) 18%, transparent), transparent 34rem),
    radial-gradient(circle at 92% 4%, color-mix(in srgb,var(--portal-accent) 20%, transparent), transparent 32rem),
    linear-gradient(135deg,#f8fbff 0%,#eef5ff 44%,#f8fafc 100%);
  background-attachment:fixed;
}
.customer-portal-body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:linear-gradient(rgba(255,255,255,.34) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.34) 1px,transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(to bottom,rgba(0,0,0,.5),transparent 68%);
}
.portal-topbar{
  margin:14px clamp(12px,2vw,28px) 0;
  border:1px solid rgba(255,255,255,.66);
  border-radius:18px;
  background:rgba(255,255,255,.72);
  box-shadow:0 18px 48px rgba(15,23,42,.10);
  backdrop-filter:blur(18px) saturate(150%);
  -webkit-backdrop-filter:blur(18px) saturate(150%);
}
.portal-brand strong{letter-spacing:.01em}
.portal-brand img,.portal-brand span{border-radius:14px;box-shadow:0 12px 24px color-mix(in srgb,var(--portal-primary) 24%, transparent)}
.portal-nav a{font-weight:650;border:1px solid transparent}
.portal-nav a:hover,.portal-pill-link{background:rgba(255,255,255,.76);border-color:rgba(255,255,255,.86);box-shadow:0 8px 22px rgba(15,23,42,.08)}
.portal-nav a.portal-logout-link{color:#b91c1c;border-color:rgba(248,113,113,.28);background:rgba(254,242,242,.72)}
.portal-nav a.portal-logout-link:hover{color:#991b1b!important;border-color:rgba(248,113,113,.48);background:#fff1f2}
.portal-sidebar{
  position:fixed;
  left:14px;
  top:96px;
  bottom:18px;
  z-index:18;
  width:244px;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:14px;
  border:1px solid rgba(255,255,255,.72);
  border-radius:22px;
  background:rgba(255,255,255,.74);
  box-shadow:0 18px 48px rgba(15,23,42,.10);
  backdrop-filter:blur(18px) saturate(145%);
  -webkit-backdrop-filter:blur(18px) saturate(145%);
  overflow:auto;
}
.portal-sidebar-profile{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px;
  border-radius:16px;
  background:rgba(255,255,255,.68);
  border:1px solid rgba(255,255,255,.78);
}
.portal-sidebar-profile span{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:900;
  background:linear-gradient(135deg,var(--portal-primary),var(--portal-accent));
  flex:0 0 auto;
}
.portal-sidebar-profile div{min-width:0}
.portal-sidebar-profile strong,.portal-sidebar-profile small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.portal-sidebar-profile small{color:#64748b;font-size:.78rem}
.portal-sidebar nav{display:grid;gap:6px}
.portal-sidebar nav a,.portal-sidebar-logout{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:42px;
  padding:10px 12px;
  border-radius:14px;
  color:#475569;
  text-decoration:none;
  font-weight:750;
  border:1px solid transparent;
}
.portal-sidebar nav a:hover,.portal-sidebar nav a.active{
  color:#0f172a;
  background:rgba(255,255,255,.76);
  border-color:rgba(255,255,255,.9);
  box-shadow:0 10px 24px rgba(15,23,42,.08);
}
.portal-sidebar nav a.active i{color:var(--portal-primary)}
.portal-sidebar-logout{
  margin-top:auto;
  color:#b91c1c;
  background:rgba(254,242,242,.72);
  border-color:rgba(248,113,113,.28);
}
.portal-sidebar-logout:hover{color:#991b1b;background:#fff1f2;border-color:rgba(248,113,113,.48)}
.has-portal-sidebar .portal-topbar{margin-left:276px}
.has-portal-sidebar .portal-main{margin-left:270px}
.has-portal-sidebar .portal-footer{margin-left:270px}
.portal-main{position:relative;z-index:1;padding-top:28px}
.portal-hero,.portal-card,.portal-kpi,.portal-list-item,.portal-product,.portal-ai-box{
  border:1px solid rgba(255,255,255,.72);
  background:rgba(255,255,255,.68);
  box-shadow:0 18px 46px rgba(15,23,42,.09);
  backdrop-filter:blur(16px) saturate(145%);
  -webkit-backdrop-filter:blur(16px) saturate(145%);
}
.portal-card,.portal-kpi,.portal-list-item,.portal-product,.portal-ai-box{border-radius:18px}
.portal-card{padding:22px}
.portal-card h1,.portal-card h2,.portal-card h3{letter-spacing:0}
.portal-hero{
  position:relative;
  overflow:hidden;
  border-radius:22px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--portal-primary) 92%, #0f172a),color-mix(in srgb,var(--portal-accent) 86%, #ffffff));
  box-shadow:0 24px 58px color-mix(in srgb,var(--portal-primary) 22%, transparent);
}
.portal-hero::after{
  content:"";
  position:absolute;
  inset:auto -12% -60% 42%;
  height:220px;
  border-radius:999px;
  background:rgba(255,255,255,.22);
  filter:blur(12px);
  transform:rotate(-8deg);
}
.portal-grid{grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr);gap:20px;align-items:start}
.portal-grid.portal-grid-balanced{grid-template-columns:repeat(2,minmax(0,1fr))}
.portal-grid.portal-grid-wide{grid-template-columns:minmax(0,1fr)}
.portal-kpis,.portal-product-grid{gap:18px}
.portal-kpi strong{font-size:clamp(1.35rem,2vw,1.9rem)}
.portal-kpi-link{display:block;color:#172033;text-decoration:none;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.portal-kpi-link:hover{color:#172033;transform:translateY(-2px);border-color:color-mix(in srgb,var(--portal-primary) 28%, rgba(255,255,255,.8));box-shadow:0 24px 52px rgba(15,23,42,.12)}
.portal-table{margin-bottom:0}
.portal-table thead th{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:#64748b;border-bottom-color:rgba(148,163,184,.45)}
.portal-table tbody td{border-color:rgba(226,232,240,.72)}
.portal-product{transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.portal-product:hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--portal-primary) 26%, rgba(255,255,255,.8));box-shadow:0 24px 56px rgba(15,23,42,.13)}
.portal-product .placeholder{height:112px;border-radius:16px;background:linear-gradient(135deg,rgba(255,255,255,.7),color-mix(in srgb,var(--portal-primary) 12%, #eef2f7));color:var(--portal-primary)}
.portal-profile-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:18px;margin-bottom:20px}
.portal-profile-avatar{
  width:74px;
  height:74px;
  border-radius:22px;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:1.65rem;
  font-weight:800;
  background:linear-gradient(135deg,var(--portal-primary),var(--portal-accent));
  box-shadow:0 18px 32px color-mix(in srgb,var(--portal-primary) 24%, transparent);
}
.portal-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.portal-section-title small{color:#64748b;font-weight:600}
.portal-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.portal-form-grid .full{grid-column:1 / -1}
.portal-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.portal-address-card{
  border:1px solid rgba(255,255,255,.78);
  border-radius:16px;
  padding:14px;
  background:rgba(255,255,255,.54);
}
.portal-address-card + .portal-address-card{margin-top:10px}
.portal-muted-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid rgba(255,255,255,.74);
  border-radius:999px;
  padding:6px 10px;
  background:rgba(255,255,255,.6);
  color:#475569;
  font-size:.82rem;
  font-weight:700;
}
.portal-footer{position:relative;z-index:1}
@media(max-width:1100px){.portal-grid,.portal-grid.portal-grid-balanced{grid-template-columns:1fr}.portal-profile-hero{grid-template-columns:1fr}}
@media(max-width:720px){
  .portal-topbar{margin:8px;border-radius:16px}
  .has-portal-sidebar .portal-topbar,.has-portal-sidebar .portal-main,.has-portal-sidebar .portal-footer{margin-left:0}
  .portal-sidebar{display:none}
  .portal-card{padding:18px}
  .portal-form-grid,.portal-checks{grid-template-columns:1fr}
  .portal-bottom-nav{background:rgba(255,255,255,.82);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);display:flex;overflow-x:auto;gap:4px;padding:6px 8px}
  .portal-bottom-nav a{min-width:66px;flex:0 0 auto;border-radius:14px}
  .portal-bottom-nav a.portal-mobile-logout{color:#b91c1c}
}

/* Customer portal admin-dashboard layout */
.customer-portal-body.has-portal-sidebar{
  background:#f3f6fb;
}
.customer-portal-body.has-portal-sidebar::before{
  display:none;
}
.has-portal-sidebar .portal-sidebar{
  inset:0 auto 0 0;
  width:270px;
  padding:18px 14px;
  border:0;
  border-radius:0;
  background:#111827;
  color:#fff;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.portal-sidebar::-webkit-scrollbar{width:8px}
.portal-sidebar::-webkit-scrollbar-track{background:#111827}
.portal-sidebar::-webkit-scrollbar-thumb{background:#475569;border-radius:999px}
.portal-sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  color:#fff;
  text-decoration:none;
  padding:2px 4px 16px;
  margin-bottom:8px;
  border-bottom:1px solid rgba(148,163,184,.18);
}
.portal-sidebar-brand span{
  width:44px;
  height:44px;
  border-radius:8px;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:linear-gradient(135deg,var(--portal-primary),var(--portal-accent));
  color:#fff;
  font-weight:900;
  flex:0 0 auto;
}
.portal-sidebar-brand img{width:100%;height:100%;object-fit:cover}
.portal-sidebar-brand strong{display:block;line-height:1.15}
.portal-sidebar-brand small{display:block;color:#a7b0c2;font-size:11px;font-weight:600;margin-top:3px}
.has-portal-sidebar .portal-sidebar-profile{
  background:#1f2937;
  border:1px solid rgba(148,163,184,.16);
  border-radius:8px;
  padding:12px;
}
.has-portal-sidebar .portal-sidebar-profile span{
  width:38px;
  height:38px;
  border-radius:8px;
}
.has-portal-sidebar .portal-sidebar-profile strong{color:#fff;font-size:.92rem}
.has-portal-sidebar .portal-sidebar-profile small{color:#a7b0c2}
.has-portal-sidebar .portal-sidebar nav{gap:3px}
.has-portal-sidebar .portal-sidebar nav a,
.has-portal-sidebar .portal-sidebar-logout{
  min-height:40px;
  border-radius:8px;
  color:#d6dbe6;
  font-weight:700;
  padding:9px 11px;
}
.has-portal-sidebar .portal-sidebar nav a:hover,
.has-portal-sidebar .portal-sidebar nav a.active{
  background:#1f2937;
  color:#fff;
  border-color:transparent;
  box-shadow:none;
}
.has-portal-sidebar .portal-sidebar nav a.active{
  border-left:3px solid var(--portal-primary);
  padding-left:8px;
}
.has-portal-sidebar .portal-sidebar nav a i{width:20px;text-align:center;color:#9ca3af}
.has-portal-sidebar .portal-sidebar nav a.active i,
.has-portal-sidebar .portal-sidebar nav a:hover i{color:#fff}
.has-portal-sidebar .portal-sidebar-logout{
  background:rgba(220,38,38,.12);
  border:1px solid rgba(248,113,113,.18);
  color:#fecaca;
}
.has-portal-sidebar .portal-sidebar-logout:hover{
  color:#fff;
  background:#991b1b;
}
.has-portal-sidebar .portal-topbar{display:none}
.has-portal-sidebar .portal-brand img,
.has-portal-sidebar .portal-brand span{
  width:38px;
  height:38px;
  border-radius:8px;
  box-shadow:none;
}
.has-portal-sidebar .portal-brand strong{
  font-size:1.15rem;
  color:#172033;
}
.has-portal-sidebar .portal-nav a{
  border-radius:8px;
  background:#f8fafc;
  border-color:#e2e8f0;
  color:#475569;
}
.has-portal-sidebar .portal-nav a:hover{
  background:#eef2ff;
  box-shadow:none;
}
.has-portal-sidebar .portal-main{
  margin-left:270px;
  padding:26px 28px 64px;
  min-height:100vh;
}
.has-portal-sidebar .portal-footer{
  margin-left:270px;
  background:#fff;
  border-top:1px solid #e2e8f0;
}
.portal-admin-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  padding:0 0 4px;
}
.portal-admin-head h1{
  margin:0;
  font-size:clamp(1.45rem,2.2vw,2rem);
  font-weight:850;
  color:#172033;
}
.portal-admin-head p{
  margin:.35rem 0 0;
  color:#64748b;
}
.portal-head-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.portal-admin-kpis,
.portal-account-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}
.portal-admin-kpi{
  position:relative;
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:10px 12px;
  align-items:center;
  min-height:118px;
  padding:18px;
  border-radius:8px;
  background:#fff;
  border:1px solid #e2e8f0;
  color:#172033;
  text-decoration:none;
  box-shadow:0 8px 20px rgba(15,23,42,.04);
  overflow:hidden;
}
.portal-admin-kpi::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  background:#0f766e;
}
.portal-admin-kpi i{
  width:42px;
  height:42px;
  border-radius:8px;
  display:grid;
  place-items:center;
  color:#fff;
  background:#0f766e;
  font-size:1.15rem;
  grid-row:1 / span 2;
}
.portal-admin-kpi span{
  color:#64748b;
  font-size:.82rem;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.portal-admin-kpi strong{
  display:block;
  font-size:clamp(1.3rem,2vw,1.75rem);
  line-height:1.1;
}
.portal-admin-kpi:hover{
  color:#172033;
  transform:translateY(-1px);
  border-color:#cbd5e1;
}
.portal-admin-kpi.blue::before,.portal-admin-kpi.blue i{background:#2563eb}
.portal-admin-kpi.amber::before,.portal-admin-kpi.amber i{background:#d97706}
.portal-admin-kpi.rose::before,.portal-admin-kpi.rose i{background:#e11d48}
.portal-admin-kpi.slate::before,.portal-admin-kpi.slate i{background:#475569}
.portal-admin-kpi.green::before,.portal-admin-kpi.green i{background:#16a34a}
.portal-admin-kpi.cyan::before,.portal-admin-kpi.cyan i{background:#0891b2}
.portal-admin-kpi.violet::before,.portal-admin-kpi.violet i{background:#7c3aed}
.portal-admin-grid{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr);
  gap:18px;
  align-items:start;
}
.has-portal-sidebar .portal-card,
.has-portal-sidebar .portal-kpi,
.has-portal-sidebar .portal-list-item,
.has-portal-sidebar .portal-product,
.has-portal-sidebar .portal-ai-box{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:8px;
  box-shadow:0 8px 20px rgba(15,23,42,.04);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.has-portal-sidebar .portal-card{padding:20px}
.has-portal-sidebar .portal-section-title small{color:#64748b}
.has-portal-sidebar .portal-list-item:hover{
  border-color:#cbd5e1;
  background:#f8fafc;
}
.portal-action-list{
  display:grid;
  gap:10px;
}
.portal-action-list a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  color:#172033;
  text-decoration:none;
  font-weight:750;
  background:#f8fafc;
}
.portal-action-list a i{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#e0f2fe;
  color:#075985;
}
.portal-action-list a.primary{
  background:#0f766e;
  color:#fff;
  border-color:#0f766e;
}
.portal-action-list a.primary i{
  background:rgba(255,255,255,.16);
  color:#fff;
}
@media(max-width:1180px){
  .portal-admin-kpis,.portal-account-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .portal-admin-grid{grid-template-columns:1fr}
}
@media(max-width:720px){
  .has-portal-sidebar .portal-topbar,
  .has-portal-sidebar .portal-main,
  .has-portal-sidebar .portal-footer{margin-left:0}
  .has-portal-sidebar .portal-topbar{
    height:auto;
    min-height:64px;
    padding:10px 14px;
  }
  .portal-admin-head{display:block}
  .portal-head-actions{justify-content:flex-start;margin-top:12px}
  .portal-admin-kpis,.portal-account-summary{grid-template-columns:1fr}
  .portal-admin-kpi{min-height:96px}
}

/* Customer portal premium workspace rebuild */
.customer-portal-body{
  --portal-shell:#f7f9fc;
  --portal-panel:#ffffff;
  --portal-border:#dde5ef;
  --portal-muted:#667085;
  --portal-text:#101828;
  --portal-soft:#f1f5f9;
  background:var(--portal-shell);
  color:var(--portal-text);
  font-size:14px;
}
.customer-portal-body.has-portal-sidebar::before{display:none}
.has-portal-sidebar .portal-sidebar{
  width:260px;
  inset:0 auto 0 0;
  padding:20px 14px;
  background:rgba(255,255,255,.96);
  color:var(--portal-text);
  border-right:1px solid var(--portal-border);
  box-shadow:none;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.has-portal-sidebar .portal-sidebar::-webkit-scrollbar-track{background:#eef2f7}
.has-portal-sidebar .portal-sidebar::-webkit-scrollbar-thumb{background:#cbd5e1}
.portal-sidebar-brand{
  padding:0 4px 18px;
  border-bottom:1px solid var(--portal-border);
}
.portal-sidebar-brand strong{color:var(--portal-text)}
.portal-sidebar-brand small{color:var(--portal-muted)}
.has-portal-sidebar .portal-sidebar-profile{
  background:#f8fafc;
  border:1px solid var(--portal-border);
  border-radius:16px;
  padding:12px;
}
.has-portal-sidebar .portal-sidebar-profile span{
  background:linear-gradient(135deg,var(--portal-primary),var(--portal-accent));
  color:#fff;
}
.has-portal-sidebar .portal-sidebar-profile strong{color:var(--portal-text)}
.has-portal-sidebar .portal-sidebar-profile small{color:var(--portal-muted)}
.has-portal-sidebar .portal-sidebar nav{gap:4px}
.has-portal-sidebar .portal-sidebar nav a,
.has-portal-sidebar .portal-sidebar-logout{
  min-height:42px;
  border-radius:12px;
  color:#475467;
  border:1px solid transparent;
  font-weight:700;
  padding:10px 12px;
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease;
}
.has-portal-sidebar .portal-sidebar nav a i{color:#667085;width:22px}
.has-portal-sidebar .portal-sidebar nav a:hover,
.has-portal-sidebar .portal-sidebar nav a.active{
  background:#eef4ff;
  color:#1849a9;
  border-color:#d1e0ff;
  transform:translateX(2px);
}
.has-portal-sidebar .portal-sidebar nav a.active{
  border-left-color:#2e66e5;
  padding-left:12px;
}
.has-portal-sidebar .portal-sidebar nav a:hover i,
.has-portal-sidebar .portal-sidebar nav a.active i{color:#1849a9}
.portal-sidebar-support{
  margin-top:auto;
  padding:14px;
  border:1px solid #d1fadf;
  border-radius:16px;
  background:#f0fdf4;
  color:#166534;
}
.portal-sidebar-support span{
  display:block;
  font-size:12px;
  color:#15803d;
  margin-bottom:3px;
}
.portal-sidebar-support a{
  color:#166534;
  font-weight:800;
  text-decoration:none;
}
.has-portal-sidebar .portal-sidebar-logout{
  margin-top:0;
  background:#fff1f2;
  border-color:#ffe4e6;
  color:#be123c;
}
.has-portal-sidebar .portal-sidebar-logout:hover{
  background:#ffe4e6;
  color:#9f1239;
}
.portal-topbar,
.has-portal-sidebar .portal-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  min-height:76px;
  margin-left:260px;
  padding:14px 32px;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--portal-border);
  position:sticky;
  top:0;
  z-index:18;
  box-shadow:none;
}
.customer-portal-body:not(.has-portal-sidebar) .portal-topbar{margin-left:0}
.portal-brand{min-width:220px}
.portal-brand img,
.portal-brand span,
.has-portal-sidebar .portal-brand img,
.has-portal-sidebar .portal-brand span{
  width:42px;
  height:42px;
  border-radius:12px;
}
.portal-brand strong{
  display:block;
  font-size:16px;
  line-height:1.12;
  color:var(--portal-text);
}
.portal-brand strong small{
  display:block;
  margin-top:4px;
  color:var(--portal-muted);
  font-size:12px;
  font-weight:700;
}
.portal-top-search{
  flex:1;
  max-width:720px;
  height:46px;
  border:1px solid var(--portal-border);
  border-radius:12px;
  background:#f8fafc;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 14px;
}
.portal-top-search i{color:#667085}
.portal-top-search input{
  border:0;
  outline:0;
  background:transparent;
  width:100%;
  color:var(--portal-text);
}
.portal-top-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}
.portal-icon-button{
  position:relative;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid var(--portal-border);
  border-radius:12px;
  background:#fff;
  color:#344054;
  text-decoration:none;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.portal-icon-button:hover{
  transform:translateY(-1px);
  border-color:#b2ccff;
  box-shadow:0 10px 24px rgba(16,24,40,.08);
}
.portal-icon-button span{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  display:grid;
  place-items:center;
  font-weight:800;
}
.portal-profile-menu{position:relative}
.portal-profile-menu summary{
  list-style:none;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:4px 10px 4px 4px;
  border:1px solid var(--portal-border);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
}
.portal-profile-menu summary::-webkit-details-marker{display:none}
.portal-profile-menu summary span{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:#fff;
  font-size:12px;
  font-weight:900;
  background:linear-gradient(135deg,var(--portal-primary),var(--portal-accent));
}
.portal-profile-menu summary strong{
  max-width:150px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}
.portal-profile-menu div{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  width:210px;
  padding:8px;
  border:1px solid var(--portal-border);
  border-radius:12px;
  background:#fff;
  box-shadow:0 18px 40px rgba(16,24,40,.12);
  animation:portalFadeIn .16s ease;
}
.portal-profile-menu div a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  color:#344054;
  text-decoration:none;
  border-radius:10px;
  font-weight:700;
}
.portal-profile-menu div a:hover{background:#f2f4f7}
.has-portal-sidebar .portal-main{
  margin-left:260px;
  width:calc(100% - 260px);
  max-width:none;
  padding:32px;
  min-height:calc(100vh - 76px);
}
.has-portal-sidebar .portal-footer{
  margin-left:260px;
  padding:24px 32px;
  background:#fff;
  border-top:1px solid var(--portal-border);
}
.portal-workspace,
.portal-catalog-shell,
.portal-product-detail{
  display:grid;
  gap:24px;
  animation:portalFadeIn .22s ease;
}
.portal-page-heading,
.portal-welcome-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:24px;
}
.portal-page-heading h1,
.portal-welcome-hero h1{
  margin:6px 0 8px;
  font-size:32px;
  line-height:1.1;
  font-weight:850;
  letter-spacing:0;
}
.portal-page-heading p,
.portal-welcome-hero p{
  margin:0;
  color:var(--portal-muted);
  max-width:720px;
}
.portal-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:#1849a9;
  background:#eef4ff;
  border:1px solid #d1e0ff;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:800;
}
.portal-welcome-hero{
  background:linear-gradient(135deg,#ffffff 0%,#f4f7ff 54%,#f0fdf4 100%);
  border:1px solid var(--portal-border);
  border-radius:16px;
  padding:32px;
  box-shadow:0 14px 36px rgba(16,24,40,.06);
  overflow:hidden;
  position:relative;
}
.portal-welcome-hero::after{
  content:"";
  position:absolute;
  right:-80px;
  top:-110px;
  width:260px;
  height:260px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(46,102,229,.16),rgba(46,102,229,0) 66%);
  pointer-events:none;
}
.portal-hero-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:24px;
}
.portal-hero-summary{
  min-width:250px;
  padding:20px;
  border:1px solid rgba(46,102,229,.14);
  border-radius:16px;
  background:rgba(255,255,255,.72);
  box-shadow:0 12px 30px rgba(16,24,40,.06);
}
.portal-hero-summary span,
.portal-hero-summary small{display:block;color:var(--portal-muted)}
.portal-hero-summary strong{
  display:block;
  margin:6px 0;
  font-size:28px;
}
.portal-stat-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:16px;
}
.portal-stat-card{
  min-height:142px;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:8px 12px;
  align-items:start;
  padding:18px;
  background:#fff;
  border:1px solid var(--portal-border);
  border-radius:16px;
  color:var(--portal-text);
  text-decoration:none;
  box-shadow:0 8px 20px rgba(16,24,40,.04);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.portal-stat-card:hover{
  transform:translateY(-2px);
  border-color:#b2ccff;
  box-shadow:0 16px 34px rgba(16,24,40,.08);
}
.portal-stat-card i{
  grid-row:1 / span 3;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:#eef4ff;
  color:#1849a9;
  font-size:18px;
}
.portal-stat-card span{
  color:var(--portal-muted);
  font-size:13px;
  font-weight:800;
}
.portal-stat-card strong{
  font-size:24px;
  line-height:1.12;
}
.portal-stat-card small{color:#98a2b3;font-weight:700}
.portal-stat-card.success i{background:#dcfae6;color:#087443}
.portal-stat-card.warning i{background:#fef0c7;color:#b54708}
.portal-stat-card.danger i,.portal-stat-card.rose i{background:#ffe4e8;color:#c01048}
.portal-stat-card.info i{background:#e0f2fe;color:#026aa2}
.portal-stat-card.indigo i,.portal-stat-card.primary i{background:#eef4ff;color:#1849a9}
.portal-stat-card.neutral i{background:#f2f4f7;color:#344054}
.portal-dashboard-layout{
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(320px,.8fr);
  gap:24px;
  align-items:start;
}
.portal-side-stack{display:grid;gap:16px}
.has-portal-sidebar .portal-card,
.has-portal-sidebar .portal-kpi,
.has-portal-sidebar .portal-list-item,
.has-portal-sidebar .portal-product,
.has-portal-sidebar .portal-ai-box{
  border-radius:16px;
  border:1px solid var(--portal-border);
  background:#fff;
  box-shadow:0 8px 20px rgba(16,24,40,.04);
}
.has-portal-sidebar .portal-card{padding:24px}
.portal-section-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.portal-section-heading h2{
  margin:0;
  font-size:22px;
  font-weight:850;
  letter-spacing:0;
}
.portal-section-heading p{
  margin:4px 0 0;
  color:var(--portal-muted);
}
.portal-section-heading a{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:#1849a9;
  text-decoration:none;
  font-weight:800;
}
.portal-table{margin:0}
.portal-table thead th{
  color:#667085;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
  border-bottom:1px solid var(--portal-border);
}
.portal-table tbody td{
  padding:14px 10px;
  vertical-align:middle;
}
.portal-table td small,
.portal-list-item small{
  display:block;
  margin-top:3px;
  color:var(--portal-muted);
}
.portal-mini-row,
.portal-total-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid #eef2f7;
}
.portal-mini-row span{
  display:grid;
  gap:2px;
  color:#475467;
}
.portal-mini-row small{color:var(--portal-muted)}
.portal-total-row{
  margin:10px 0 16px;
  border-bottom:0;
  font-size:16px;
}
.portal-rewards-card{
  background:linear-gradient(135deg,#ffffff,#f0f9ff);
}
.portal-rewards-card h2{
  margin:12px 0 6px;
  font-size:22px;
  font-weight:850;
}
.portal-rewards-card p{color:var(--portal-muted)}
.portal-action-list.compact a{background:#f8fafc}
.portal-filter-card .form-label{
  color:#344054;
  font-size:13px;
  font-weight:800;
}
.portal-input-icon{
  position:relative;
}
.portal-input-icon i{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:#667085;
}
.portal-input-icon .form-control{padding-left:42px}
.portal-catalog-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:var(--portal-muted);
  font-weight:700;
}
.portal-catalog-meta a{color:#1849a9;text-decoration:none}
.portal-product-grid.premium{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:18px;
}
.portal-product.premium{
  min-height:100%;
  padding:14px;
  border-radius:16px;
  color:var(--portal-text);
  gap:14px;
  overflow:hidden;
}
.portal-product.premium:hover{
  transform:translateY(-3px);
  border-color:#b2ccff;
  box-shadow:0 18px 38px rgba(16,24,40,.1);
}
.portal-product-media{
  height:150px;
  border-radius:14px;
  background:linear-gradient(135deg,#eef4ff,#f8fafc);
  border:1px solid #eef2f7;
  display:grid;
  place-items:center;
  overflow:hidden;
  color:#1849a9;
  text-align:center;
}
.portal-product-media.large{height:430px}
.portal-product-media img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.portal-product-media i{font-size:34px}
.portal-product-media span{
  display:block;
  margin-top:4px;
  font-weight:900;
  letter-spacing:.04em;
}
.portal-product-meta{
  display:grid;
  gap:7px;
}
.portal-product-meta > div:first-child{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
}
.portal-product-meta h3,
.portal-buy-panel h1{
  margin:0;
  font-size:17px;
  line-height:1.28;
  font-weight:850;
}
.portal-buy-panel h1{font-size:32px}
.portal-product-meta h3 a{
  color:var(--portal-text);
  text-decoration:none;
}
.portal-product-meta small{color:var(--portal-muted)}
.portal-product-meta strong,
.portal-product-price{
  color:#101828;
  font-size:20px;
  font-weight:900;
}
.portal-rating{
  display:inline-flex;
  align-items:center;
  gap:4px;
  color:#b54708;
  font-size:12px;
  font-weight:850;
}
.portal-stock-badge{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:850;
}
.portal-stock-badge.in{background:#dcfae6;color:#087443}
.portal-stock-badge.low{background:#fef0c7;color:#b54708}
.portal-stock-badge.out{background:#fee4e2;color:#b42318}
.portal-product-actions{
  margin-top:auto;
  display:grid;
  grid-template-columns:70px 1fr 1fr auto;
  gap:8px;
  align-items:center;
}
.portal-product-actions .btn-light{
  border:1px solid var(--portal-border);
}
.portal-quick-view{
  color:#1849a9;
  text-decoration:none;
  font-weight:800;
  font-size:13px;
}
.portal-product-detail-grid{
  display:grid;
  grid-template-columns:minmax(0,1.12fr) minmax(360px,.88fr);
  gap:24px;
  align-items:start;
}
.portal-back-link{
  width:max-content;
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#1849a9;
  text-decoration:none;
  font-weight:800;
}
.portal-product-copy{
  margin:16px 0;
  color:#475467;
  line-height:1.7;
}
.portal-stock-note{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border:1px solid #d1fadf;
  border-radius:14px;
  background:#f0fdf4;
  color:#166534;
}
.portal-stock-note i{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#dcfae6;
}
.portal-stock-note span{font-weight:800}
.portal-stock-note strong{margin-left:auto}
.portal-buy-form{
  display:grid;
  gap:14px;
  margin-top:18px;
}
.portal-buy-form label{
  display:grid;
  gap:7px;
  color:#344054;
  font-weight:800;
}
.portal-buy-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.portal-empty-state{
  width:100%;
  min-height:128px;
  display:grid;
  place-items:center;
  text-align:center;
  gap:6px;
  color:var(--portal-muted);
  padding:18px;
}
.portal-empty-state i{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#eef4ff;
  color:#1849a9;
  font-size:20px;
}
.portal-empty-state strong{
  color:var(--portal-text);
  font-size:16px;
}
.btn{
  border-radius:12px;
  font-weight:800;
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease;
}
.btn:hover{transform:translateY(-1px)}
.form-control,.form-select{
  border-radius:12px;
  border-color:var(--portal-border);
  min-height:44px;
}
@keyframes portalFadeIn{
  from{opacity:0;transform:translateY(6px)}
  to{opacity:1;transform:none}
}
@media(min-width:1600px){
  .has-portal-sidebar .portal-main{padding:40px}
  .portal-product-grid.premium{grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}
}
@media(max-width:1180px){
  .portal-dashboard-layout,
  .portal-product-detail-grid{grid-template-columns:1fr}
  .portal-product-media.large{height:320px}
  .portal-top-search{max-width:none}
  .portal-profile-menu summary strong{display:none}
}
@media(max-width:900px){
  .has-portal-sidebar .portal-sidebar{display:none}
  .portal-topbar,
  .has-portal-sidebar .portal-topbar{
    margin:0;
    margin-left:0;
    padding:12px 16px;
    gap:12px;
    flex-wrap:wrap;
  }
  .portal-brand{min-width:auto}
  .portal-top-search{order:3;flex-basis:100%;height:44px}
  .has-portal-sidebar .portal-main,
  .has-portal-sidebar .portal-footer{
    margin-left:0;
    width:100%;
  }
  .has-portal-sidebar .portal-main{padding:20px 16px 96px}
  .has-portal-sidebar .portal-footer{padding:20px 16px 90px}
}
@media(max-width:640px){
  .portal-page-heading,
  .portal-welcome-hero{
    align-items:flex-start;
    display:grid;
  }
  .portal-page-heading h1,
  .portal-welcome-hero h1{font-size:26px}
  .portal-welcome-hero{padding:22px}
  .portal-hero-summary{min-width:0;width:100%}
  .portal-stat-grid{grid-template-columns:1fr}
  .portal-product-grid.premium{grid-template-columns:1fr}
  .portal-product-actions{grid-template-columns:72px 1fr auto}
  .portal-product-actions .btn-outline-primary{grid-column:1 / -1}
  .portal-product-media.large{height:260px}
  .portal-section-heading{display:grid}
  .portal-icon-button{width:40px;height:40px}
  .portal-profile-menu summary{padding-right:4px}
  .portal-profile-menu summary i{display:none}
}

.upos-ai{position:fixed;right:max(24px,env(safe-area-inset-right));bottom:max(24px,env(safe-area-inset-bottom));z-index:2100;pointer-events:none}
.upos-ai-button,.upos-ai-panel,.upos-ai-backdrop{pointer-events:auto}
.upos-ai-button{position:relative;width:72px;height:72px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:#08111f;box-shadow:0 18px 48px rgba(15,23,42,.28),0 0 0 1px rgba(31,94,255,.16);animation:upos-ai-float 5.6s ease-in-out infinite;transition:transform .18s ease,box-shadow .18s ease,opacity .18s ease}
.upos-ai-button:hover{transform:translateY(-2px) scale(1.05);box-shadow:0 22px 58px rgba(15,23,42,.34),0 0 0 1px rgba(15,139,114,.22)}
.upos-ai-button img{position:relative;z-index:2;width:58px;height:58px;filter:drop-shadow(0 6px 18px rgba(56,189,248,.45))}
.upos-ai-button-glow{position:absolute;inset:-8px;border-radius:inherit;background:radial-gradient(circle,rgba(56,189,248,.34),rgba(15,139,114,.12) 48%,transparent 72%);animation:upos-ai-breathe 3.6s ease-in-out infinite}
.upos-ai-notice{position:absolute;top:8px;right:8px;width:14px;height:14px;border:2px solid #fff;border-radius:50%;background:#0f8b72;box-shadow:0 0 0 0 rgba(15,139,114,.56);animation:upos-ai-notification 2.8s ease-out infinite}
.upos-ai-backdrop{position:fixed;inset:0;display:none;background:rgba(15,23,42,.34);backdrop-filter:blur(2px)}
.upos-ai-panel{position:fixed;top:18px;right:18px;width:min(470px,calc(100vw - 36px));height:calc(100vh - 36px);display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(228,233,241,.96);border-radius:8px;background:#fff;box-shadow:0 28px 90px rgba(15,23,42,.28);opacity:0;transform:translateX(calc(100% + 32px));transition:transform .24s ease,opacity .24s ease}
.upos-ai.is-open .upos-ai-panel{opacity:1;transform:translateX(0)}
.upos-ai.is-open .upos-ai-backdrop{display:block}
.upos-ai.is-open .upos-ai-button{opacity:0;transform:scale(.86);pointer-events:none}
.upos-ai-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px;border-bottom:1px solid #e4e9f1;background:linear-gradient(135deg,#fff,#f7fbff)}
.upos-ai-title{display:flex;align-items:center;gap:12px;min-width:0}.upos-ai-title img{width:44px;height:44px;flex:0 0 44px}.upos-ai-title strong,.upos-ai-title span{display:block}.upos-ai-title strong{color:#111827;font-size:1rem}.upos-ai-title span{color:#667085;font-size:.82rem;font-weight:700}.upos-ai-title i{color:#0f8b72;font-size:.52rem}
.upos-ai-actions{display:flex;gap:6px;flex:0 0 auto}.upos-ai-actions button,.upos-ai-actions a,.upos-ai-composer-actions button{width:34px;height:34px;display:inline-grid;place-items:center;border:1px solid #e4e9f1;border-radius:8px;background:#fff;color:#111827;text-decoration:none;transition:background .16s ease,border-color .16s ease,transform .16s ease}.upos-ai-actions button:hover,.upos-ai-actions a:hover,.upos-ai-composer-actions button:hover{border-color:rgba(31,94,255,.34);background:#eef4ff;transform:translateY(-1px)}
.upos-ai-context{margin:14px 16px 0;padding:12px;border:1px solid #d9e7fb;border-radius:8px;background:#f8fbff}.upos-ai-context span,.upos-ai-context strong{display:block}.upos-ai-context span{color:#667085;font-size:.74rem;font-weight:800;text-transform:uppercase}.upos-ai-context strong{margin-top:2px;color:#111827;font-size:.94rem}
.upos-ai-history{margin:10px 16px 0;padding:12px;border:1px solid #e4e9f1;border-radius:8px;background:#fff}.upos-ai-history-head{display:flex;justify-content:space-between;gap:10px;font-size:.85rem}.upos-ai-history-head a{font-size:.78rem;font-weight:800;color:#1849a9}.upos-ai-history-empty{margin-top:8px;color:#667085;font-size:.82rem}
.upos-ai-messages{min-height:0;flex:1;display:flex;flex-direction:column;gap:14px;overflow-y:auto;padding:16px}.upos-ai-message{display:flex;align-items:flex-start;gap:10px}.upos-ai-message-user{justify-content:flex-end}.upos-ai-avatar{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border-radius:50%;background:#08111f}.upos-ai-avatar img{width:28px;height:28px}.upos-ai-message-body{max-width:min(340px,86%);padding:11px 13px;border:1px solid #e4e9f1;border-radius:8px;background:#fff;color:#111827;box-shadow:0 8px 24px rgba(15,23,42,.06);font-size:.92rem;line-height:1.48}.upos-ai-message-user .upos-ai-message-body{border-color:rgba(31,94,255,.18);background:#1f5eff;color:#fff}.upos-ai-message-body p:last-child,.upos-ai-message-body ul:last-child{margin-bottom:0}.upos-ai-message-body code,.upos-ai-message-body pre{border-radius:8px;background:#eef2f7;color:#111827}.upos-ai-message-body code{padding:.1rem .28rem}.upos-ai-message-body pre{overflow-x:auto;padding:10px}.upos-ai-table-wrap{overflow-x:auto}.upos-ai-table-wrap table{width:100%;border-collapse:collapse;font-size:.84rem}.upos-ai-table-wrap th,.upos-ai-table-wrap td{padding:8px;border:1px solid #e4e9f1;text-align:left}.upos-ai-table-wrap th{background:#f8fafc}
.upos-ai-message-typing .upos-ai-message-body{display:flex;width:72px;gap:5px;justify-content:center}.upos-ai-message-typing span{width:7px;height:7px;border-radius:50%;background:#60a5fa;animation:upos-ai-typing 1s ease-in-out infinite}.upos-ai-message-typing span:nth-child(2){animation-delay:.14s}.upos-ai-message-typing span:nth-child(3){animation-delay:.28s}
.upos-ai-suggestions,.upos-ai-actions-strip{display:flex;gap:8px;overflow-x:auto;padding:0 16px 12px}.upos-ai-suggestions button{flex:0 0 auto;padding:8px 10px;border:1px solid #d9e7fb;border-radius:8px;background:#f8fbff;color:#1849a9;font-size:.82rem;font-weight:700;white-space:nowrap}.upos-ai-actions-strip a{flex:0 0 auto;padding:7px 10px;border:1px solid #cfe0ff;border-radius:8px;background:#eef4ff;color:#1849a9;font-size:.78rem;font-weight:800;text-decoration:none;white-space:nowrap}.upos-ai-actions-strip a:hover{background:#dfeaff}
.upos-ai-status{min-height:20px;padding:0 16px 8px;color:#667085;font-size:.78rem}.upos-ai-composer{display:grid;gap:10px;padding:14px 16px 16px;border-top:1px solid #e4e9f1;background:#fff}.upos-ai-composer textarea{width:100%;min-height:86px;max-height:170px;resize:vertical;padding:12px;border:1px solid #e4e9f1;border-radius:8px;outline:0;font:inherit}.upos-ai-composer textarea:focus{border-color:rgba(31,94,255,.55);box-shadow:0 0 0 3px rgba(31,94,255,.12)}.upos-ai-composer-actions{display:flex;justify-content:flex-end;gap:8px}.upos-ai-composer-actions .upos-ai-send{border-color:#1f5eff;background:#1f5eff;color:#fff}
@keyframes upos-ai-float{0%,100%{translate:0 0}50%{translate:0 -7px}}@keyframes upos-ai-breathe{0%,100%{opacity:.72;transform:scale(.94)}50%{opacity:1;transform:scale(1.08)}}@keyframes upos-ai-notification{0%{box-shadow:0 0 0 0 rgba(15,139,114,.56)}72%,100%{box-shadow:0 0 0 12px rgba(15,139,114,0)}}@keyframes upos-ai-typing{0%,100%{opacity:.35;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}
@media(max-width:575px){.upos-ai{right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom))}.upos-ai-button{width:62px;height:62px}.upos-ai-button img{width:50px;height:50px}.upos-ai-panel{inset:0;width:100vw;height:100vh;border:0;border-radius:0}.upos-ai-header{padding-top:max(16px,env(safe-area-inset-top))}.upos-ai-message-body{max-width:84%}}
