
/* Stage 390 — Sidebar Professional Polish
   Visual-only enhancement over Stage 389 Windows UI transfer. Backend/OAuth/bridge logic is unchanged. */
:root{
  --s390-sidebar-w: 288px;
  --s390-bg-0:#07101d;
  --s390-bg-1:#0b1728;
  --s390-surface:rgba(12,23,40,.94);
  --s390-surface-2:rgba(15,30,53,.92);
  --s390-line:rgba(126,157,213,.18);
  --s390-line-strong:rgba(142,197,255,.26);
  --s390-text:#eef6ff;
  --s390-muted:#9fb4d8;
  --s390-gold:#f3c767;
  --s390-blue:#5ea8ff;
  --s390-green:#2dd4a7;
  --s390-red:#fb7185;
  --s390-radius-lg:22px;
  --s390-radius-md:16px;
  --s390-shadow:0 24px 58px rgba(2,6,23,.26);
  --s390-inner:inset 0 1px 0 rgba(255,255,255,.045), inset 0 -1px 0 rgba(0,0,0,.22);
}
body.stage390-sidebar-polish{
  background:
    radial-gradient(circle at 10% 0%,rgba(37,99,235,.12),transparent 32%),
    radial-gradient(circle at 92% 8%,rgba(245,158,11,.075),transparent 26%),
    linear-gradient(180deg,#06101d 0%,#07111f 42%,#050b14 100%) !important;
}
body.stage390-sidebar-polish .shell{
  grid-template-columns:var(--s390-sidebar-w) minmax(0,1fr) !important;
  gap:16px !important;
  padding:10px 14px 12px !important;
  background:transparent !important;
}
body.stage390-sidebar-polish .sidebar{
  padding:14px 12px 18px !important;
  background:
    radial-gradient(circle at 12% 0%,rgba(94,168,255,.13),transparent 29%),
    linear-gradient(180deg,rgba(10,22,40,.98),rgba(7,15,28,.98) 56%,rgba(6,13,24,.98)) !important;
  border:1px solid rgba(128,164,223,.18) !important;
  border-radius:0 24px 24px 0 !important;
  box-shadow:var(--s390-shadow), inset -1px 0 0 rgba(255,255,255,.035) !important;
  scrollbar-color:rgba(94,168,255,.70) rgba(7,16,30,.55) !important;
}
body.stage390-sidebar-polish .sidebar::-webkit-scrollbar{width:8px}
body.stage390-sidebar-polish .sidebar::-webkit-scrollbar-thumb{background:linear-gradient(180deg,rgba(94,168,255,.9),rgba(29,78,216,.7));border-radius:999px}
body.stage390-sidebar-polish .brand{
  position:relative;
  align-items:center !important;
  gap:12px !important;
  padding:8px 8px 14px !important;
  margin:0 0 12px !important;
  border-bottom:1px solid rgba(126,157,213,.14);
}
body.stage390-sidebar-polish .brand::after{
  content:"";position:absolute;left:10px;right:10px;bottom:-1px;height:1px;
  background:linear-gradient(90deg,rgba(243,199,103,.0),rgba(243,199,103,.6),rgba(94,168,255,.0));
}
body.stage390-sidebar-polish .brand .logo{width:72px !important;filter:drop-shadow(0 14px 22px rgba(243,199,103,.22)) !important}
body.stage390-sidebar-polish .brand h1{font-size:17px !important;line-height:1.05 !important;letter-spacing:-.035em !important;color:#f4f8ff !important}
body.stage390-sidebar-polish .brand p{font-size:12px !important;line-height:1.45 !important;color:#aec1e3 !important;margin-top:6px !important}
body.stage390-sidebar-polish .stage390-sidebar-intel{
  display:grid;gap:10px;margin:0 0 12px;padding:14px;border-radius:20px;
  border:1px solid rgba(243,199,103,.18);
  background:
    radial-gradient(circle at 90% 0%,rgba(45,212,167,.13),transparent 25%),
    linear-gradient(145deg,rgba(16,29,50,.96),rgba(8,17,31,.96));
  box-shadow:0 18px 42px rgba(2,6,23,.22),var(--s390-inner);
}
body.stage390-sidebar-polish .stage390-intel-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
body.stage390-sidebar-polish .stage390-intel-title{font-weight:800;color:#f7fbff;font-size:13px;letter-spacing:-.01em}
body.stage390-sidebar-polish .stage390-intel-sub{margin-top:4px;color:#a9bad7;font-size:11.5px;line-height:1.45}
body.stage390-sidebar-polish .stage390-live-dot{width:9px;height:9px;border-radius:99px;background:#34d399;box-shadow:0 0 0 5px rgba(52,211,153,.12),0 0 18px rgba(52,211,153,.65)}
body.stage390-sidebar-polish .stage390-intel-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
body.stage390-sidebar-polish .stage390-intel-cell{padding:9px 8px;border-radius:14px;border:1px solid rgba(126,157,213,.16);background:linear-gradient(180deg,rgba(13,27,49,.96),rgba(8,18,34,.94));box-shadow:var(--s390-inner)}
body.stage390-sidebar-polish .stage390-intel-cell span{display:block;color:#8fa6cb;text-transform:uppercase;font-size:9px;letter-spacing:.09em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.stage390-sidebar-polish .stage390-intel-cell strong{display:block;margin-top:4px;color:#f1f7ff;font-size:12px;line-height:1.1}
body.stage390-sidebar-polish .design-banner,
body.stage390-sidebar-polish .sidebar-surface,
body.stage390-sidebar-polish .panel.sidebar-surface{
  border-radius:20px !important;
  border:1px solid var(--s390-line) !important;
  background:
    radial-gradient(circle at 100% 0%,rgba(94,168,255,.11),transparent 26%),
    linear-gradient(180deg,rgba(13,26,46,.96),rgba(8,18,33,.965)) !important;
  box-shadow:0 18px 44px rgba(2,6,23,.20),var(--s390-inner) !important;
}
body.stage390-sidebar-polish .design-banner{padding:16px !important;margin-bottom:12px !important;border-color:rgba(243,199,103,.18) !important}
body.stage390-sidebar-polish .sidebar-panel-head{align-items:center !important;gap:12px !important;margin-bottom:10px !important}
body.stage390-sidebar-polish .sidebar-panel-title,
body.stage390-sidebar-polish .design-banner h3{font-size:16px !important;line-height:1.08 !important;letter-spacing:-.025em !important;color:#f6f9ff !important}
body.stage390-sidebar-polish .label{font-size:10px !important;letter-spacing:.11em !important;color:#8ea5ca !important}
body.stage390-sidebar-polish .sidebar-banner-copy,
body.stage390-sidebar-polish .sidebar-panel-copy,
body.stage390-sidebar-polish .sub{font-size:12px !important;line-height:1.55 !important;color:#aebfdd !important}
body.stage390-sidebar-polish .sidebar-head-badge{
  padding:7px 11px !important;border-radius:999px !important;font-size:10px !important;letter-spacing:.09em !important;font-weight:850 !important;
  color:#dffcf2 !important;border:1px solid rgba(45,212,167,.26) !important;
  background:linear-gradient(180deg,rgba(8,101,75,.46),rgba(6,57,51,.44)) !important;
  box-shadow:0 0 0 1px rgba(45,212,167,.06),0 12px 28px rgba(2,6,23,.18) !important;
}
body.stage390-sidebar-polish .sidebar-micro-grid,
body.stage390-sidebar-polish .sidebar-mini-grid{gap:10px !important}
body.stage390-sidebar-polish .sidebar-micro-card,
body.stage390-sidebar-polish .sidebar-mini-card{
  border-radius:15px !important;border:1px solid rgba(126,157,213,.17) !important;
  background:linear-gradient(180deg,rgba(14,29,52,.98),rgba(8,18,34,.96)) !important;
  box-shadow:0 12px 26px rgba(2,6,23,.16),var(--s390-inner) !important;
}
body.stage390-sidebar-polish .sidebar-micro-card span,
body.stage390-sidebar-polish .sidebar-mini-card .label,
body.stage390-sidebar-polish .sidebar-mini-card .sub{text-transform:uppercase;letter-spacing:.09em;color:#91a8cd !important;font-size:10px !important}
body.stage390-sidebar-polish .sidebar-micro-card strong,
body.stage390-sidebar-polish .sidebar-mini-card div:not(.label):not(.sub){color:#f2f7ff !important;font-weight:750 !important}
body.stage390-sidebar-polish .pill-row{gap:8px !important}
body.stage390-sidebar-polish .pill{
  min-height:34px;display:inline-flex;align-items:center;border-radius:999px !important;
  border:1px solid rgba(126,157,213,.18) !important;background:linear-gradient(180deg,rgba(13,26,46,.95),rgba(8,18,34,.96)) !important;
  color:#dce9ff !important;font-size:11.5px !important;font-weight:700 !important;box-shadow:var(--s390-inner) !important;
}
body.stage390-sidebar-polish .sidebar-banner-footer{border-top:1px solid rgba(126,157,213,.12);padding-top:12px;margin-top:12px}
body.stage390-sidebar-polish input,
body.stage390-sidebar-polish select,
body.stage390-sidebar-polish textarea,
body.stage390-sidebar-polish button{
  border-radius:14px !important;min-height:42px !important;
}
body.stage390-sidebar-polish input,
body.stage390-sidebar-polish select,
body.stage390-sidebar-polish textarea{
  border:1px solid rgba(126,157,213,.18) !important;background:linear-gradient(180deg,rgba(10,22,39,.98),rgba(7,16,30,.97)) !important;color:#edf5ff !important;
}
body.stage390-sidebar-polish .action-grid--sidebar{gap:8px !important}
body.stage390-sidebar-polish .action-grid--sidebar button,
body.stage390-sidebar-polish .sidebar button.secondary,
body.stage390-sidebar-polish #resyncBtn{
  position:relative;overflow:hidden;text-align:left;padding-left:36px !important;
  border:1px solid rgba(126,157,213,.18) !important;
  background:linear-gradient(180deg,rgba(17,36,64,.98),rgba(9,21,38,.98)) !important;
  color:#eef6ff !important;font-weight:800 !important;font-size:12px !important;
  box-shadow:0 12px 26px rgba(2,6,23,.16),var(--s390-inner) !important;
}
body.stage390-sidebar-polish .action-grid--sidebar button::before,
body.stage390-sidebar-polish .sidebar button.secondary::before,
body.stage390-sidebar-polish #resyncBtn::before{
  content:"";position:absolute;left:13px;top:50%;width:8px;height:8px;transform:translateY(-50%);border-radius:99px;background:var(--s390-blue);box-shadow:0 0 14px rgba(94,168,255,.54)
}
body.stage390-sidebar-polish #emergencyStopBtn::before{background:var(--s390-red);box-shadow:0 0 14px rgba(251,113,133,.54)}
body.stage390-sidebar-polish #startBtn::before,
body.stage390-sidebar-polish #resumeAutoBtn::before,
body.stage390-sidebar-polish #manualBuyBtn::before{background:var(--s390-green);box-shadow:0 0 14px rgba(45,212,167,.54)}
body.stage390-sidebar-polish .sidebar button:hover{transform:translateY(-1px);border-color:var(--s390-line-strong) !important;filter:saturate(1.05)}
body.stage390-sidebar-polish .sidebar-status-box{
  border:1px solid rgba(126,157,213,.16) !important;border-radius:16px !important;
  background:linear-gradient(180deg,rgba(9,20,37,.72),rgba(5,12,23,.78)) !important;box-shadow:var(--s390-inner) !important;
}
body.stage390-sidebar-polish .table.sidebar-table{border-radius:16px !important;overflow:hidden;border:1px solid rgba(126,157,213,.14)}
body.stage390-sidebar-polish #heroSummary{max-width:980px !important;color:#d3def1 !important;line-height:1.62 !important}
body.stage390-sidebar-polish .hero-media-cta__copy small{font-size:11px !important;letter-spacing:.05em;text-transform:uppercase;color:#a8bad7 !important}
@media (min-width: 1181px){
  body.stage390-sidebar-polish .sidebar{position:sticky !important;top:10px;height:calc(100vh - 20px) !important;align-self:start !important}
  body.stage390-sidebar-polish .main{padding-top:0 !important}
}
@media (max-width: 1280px){
  body.stage390-sidebar-polish{--s390-sidebar-w:268px}
  body.stage390-sidebar-polish .shell{gap:12px !important;padding:8px !important}
  body.stage390-sidebar-polish .brand .logo{width:64px !important}
}
@media (max-width: 1180px){
  body.stage390-sidebar-polish .shell{display:block !important;padding:10px !important}
  body.stage390-sidebar-polish .sidebar{border-radius:22px !important;height:auto !important;max-height:none !important;margin-bottom:12px !important;position:relative !important;top:auto !important}
  body.stage390-sidebar-polish .brand{padding-right:10px !important}
  body.stage390-sidebar-polish .stage390-sidebar-intel{grid-template-columns:1fr;}
  body.stage390-sidebar-polish .main{height:auto !important;min-height:auto !important;overflow:visible !important}
}
@media (max-width: 760px){
  body.stage390-sidebar-polish .shell{padding:8px !important}
  body.stage390-sidebar-polish .sidebar{padding:12px 10px 14px !important;border-radius:18px !important}
  body.stage390-sidebar-polish .brand{gap:10px !important;padding:4px 4px 12px !important}
  body.stage390-sidebar-polish .brand .logo{width:58px !important}
  body.stage390-sidebar-polish .brand h1{font-size:15px !important}
  body.stage390-sidebar-polish .stage390-intel-grid,
  body.stage390-sidebar-polish .sidebar-micro-grid,
  body.stage390-sidebar-polish .sidebar-mini-grid,
  body.stage390-sidebar-polish .row2,
  body.stage390-sidebar-polish .action-grid--sidebar{grid-template-columns:1fr !important}
  body.stage390-sidebar-polish .design-banner,
  body.stage390-sidebar-polish .sidebar-surface{border-radius:18px !important;padding:14px !important}
  body.stage390-sidebar-polish #heroSummary{font-size:14px !important;line-height:1.58 !important}
}
