:root{--bg:#f4f7fb;--panel:#fff;--text:#152230;--muted:#6f7d8b;--line:#dde5ec;--accent:#0f2f49;--soft:#edf3f7;--danger:#b42318;--shadow:0 18px 50px rgba(15,47,73,.08);--radius:18px}
[data-theme=dark]{--bg:#0b1220;--panel:#111b2b;--text:#edf4fb;--muted:#9eb0c2;--line:#24334a;--accent:#4ca5c5;--soft:#182437;--shadow:0 18px 50px rgba(0,0,0,.25)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}.hidden{display:none!important}
.auth-screen{position:fixed;inset:0;display:grid;place-items:center;padding:20px;background:linear-gradient(145deg,#081827,#174b68);z-index:100}.auth-card{width:min(560px,100%);background:var(--panel);border-radius:26px;padding:28px;box-shadow:0 35px 100px rgba(0,0,0,.35)}
.brand-row{display:flex;align-items:center;gap:12px}.brand-mark{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(135deg,#1f6f8b,#6bc2dd);color:#fff;font-weight:900}.auth-card h1{margin:0}.auth-card p{margin:4px 0 0;color:var(--muted)}
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;background:var(--soft);padding:5px;border-radius:12px;margin:22px 0}.auth-tab{border:0;background:transparent;padding:11px;border-radius:9px;font-weight:800;color:var(--muted);cursor:pointer}.auth-tab.active{background:var(--panel);color:var(--text)}.auth-form{display:none;gap:14px}.auth-form.active{display:grid}
.auth-link{border:0;background:transparent;color:#19724b;font:inherit;font-weight:800;padding:4px;cursor:pointer;text-align:center}.auth-link:hover{text-decoration:underline}.auth-message{margin-top:16px;padding:12px 14px;border-radius:12px;background:#eaf6ef;color:#1d613f;font-weight:700;line-height:1.45}.auth-message.error{background:#fff0ef;color:#9b2c24}.auth-form h2{margin:0}.auth-form p{margin:5px 0 0}
.app{min-height:100vh;display:grid;grid-template-columns:250px 1fr}.sidebar{background:#0d2338;color:#fff;padding:20px 16px;display:flex;flex-direction:column;min-height:100vh;position:sticky;top:0;height:100vh}.sidebar-top{display:flex;justify-content:space-between;gap:10px}.brand-copy strong,.brand-copy span{display:block}.brand-copy span{font-size:12px;color:#9fb4c8}.sidebar nav{display:grid;gap:7px;margin-top:26px}.nav{border:0;background:transparent;color:#c7d6e4;border-radius:11px;padding:12px 13px;text-align:left;display:flex;gap:12px;align-items:center;font-weight:750;cursor:pointer;white-space:nowrap}.nav:hover,.nav.active{background:#173d5e;color:#fff}.nav.danger{color:#ffb4ad}.sidebar-bottom{margin-top:auto;border-top:1px solid #29445e;padding-top:14px}.icon-btn{width:36px;height:36px;border:1px solid var(--line);background:var(--soft);color:var(--text);border-radius:10px;cursor:pointer}.sidebar .icon-btn{border-color:#31516e;background:#173d5e;color:#fff}
.app.collapsed{grid-template-columns:82px 1fr}.app.collapsed .brand-copy,.app.collapsed .nav b{display:none}.app.collapsed .sidebar{padding-inline:12px}.app.collapsed .nav{justify-content:center}.app.collapsed .sidebar-top{display:grid;justify-content:center}.app.collapsed #collapseBtn{transform:rotate(180deg);margin:auto}
.main{min-width:0}.topbar{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:26px 30px 18px}.topbar h1{margin:0}.topbar p{margin:5px 0 0;color:var(--muted)}.top-actions,.row{display:flex;gap:10px;align-items:center}.wrap{flex-wrap:wrap}.save-state{font-size:12px;color:var(--muted)}.view{display:none;padding:0 30px 42px}.view.active{display:block}
.card,.stat-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px}.card h2,.card h3{margin-top:0}.card p{color:var(--muted)}.card-head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:18px}
.grid{display:grid;gap:14px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.content-grid{display:grid;gap:22px}.profile-grid{grid-template-columns:290px 1fr}.two-col{grid-template-columns:1fr 1fr}.calc-grid{grid-template-columns:minmax(0,1.3fr) minmax(340px,.7fr)}.stack{display:grid;gap:22px}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.stat-card span{display:block;color:var(--muted);font-size:13px}.stat-card strong{display:block;font-size:28px;margin-top:6px}
label{display:grid;gap:6px;font-size:13px;font-weight:750}input,select,textarea{width:100%;border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:11px;padding:11px 12px}textarea{resize:vertical}.btn{border:0;border-radius:11px;padding:11px 15px;font-weight:800;cursor:pointer}.btn.primary{background:var(--accent);color:#fff}.btn.secondary{background:var(--soft);color:var(--text)}.btn.ghost{background:transparent;border:1px solid var(--line);color:var(--text)}.btn.small{padding:7px 10px;font-size:12px}.wide{width:100%}.file-label{position:relative;overflow:hidden;display:inline-flex}.file-label input{position:absolute;inset:0;opacity:0}.section-gap{margin-top:18px}details{border-top:1px solid var(--line);margin-top:20px;padding-top:16px}summary{cursor:pointer;font-weight:850}.details-body{margin-top:15px}
.profile-preview{background:linear-gradient(145deg,#0f2f49,#174f70);color:#fff;position:sticky;top:18px;align-self:start}.profile-preview p{color:#cbe0eb}.logo-frame{min-height:90px;display:flex;align-items:center}.logo-frame img{display:none;max-width:190px;max-height:85px;object-fit:contain;background:#fff;border-radius:12px;padding:8px}.avatar{width:78px;height:78px;border-radius:20px;display:grid;place-items:center;background:rgba(255,255,255,.14);font-size:24px;font-weight:900}.preview-lines{display:grid;gap:8px;color:#d8e7ef;font-size:13px;margin-top:20px}
.price-card{background:linear-gradient(145deg,#0f2f49,#174f70);color:#fff}.price-card>span,.price-card small{display:block;color:#cbe0eb}.price-card>strong{display:block;font-size:44px;margin:4px 0}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}.metric-grid div{border-top:1px solid rgba(255,255,255,.14);padding-top:10px}.metric-grid span,.metric-grid b{display:block}.metrics div{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.data-list{display:grid;gap:10px}.data-row{display:grid;grid-template-columns:42px minmax(170px,1.3fr) repeat(3,minmax(110px,.7fr)) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:13px;background:var(--panel)}.data-row.dragging{opacity:.45}.drag-handle{cursor:grab;font-size:22px;color:var(--muted);user-select:none}.row-actions{display:flex;gap:7px;flex-wrap:wrap}.data-label{font-size:11px;text-transform:uppercase;color:var(--muted);display:none}
.modal{position:fixed;inset:0;display:none;place-items:center;background:rgba(4,13,22,.58);padding:18px;z-index:50}.modal.open{display:grid}.modal-card{width:min(760px,100%);max-height:90vh;overflow:auto;background:var(--panel);border-radius:20px;padding:22px}.toast-host{position:fixed;top:18px;right:18px;z-index:200;display:grid;gap:10px}.toast{background:#14293d;color:#fff;padding:12px 15px;border-radius:12px}
@media(max-width:1100px){.app{grid-template-columns:84px 1fr}.brand-copy,.nav b{display:none}.sidebar{padding-inline:12px}.nav{justify-content:center}.sidebar-top{display:grid;justify-content:center}.calc-grid,.profile-grid{grid-template-columns:1fr}.profile-preview{position:static}.stats-grid{grid-template-columns:repeat(2,1fr)}.grid.three{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.app{display:block}.sidebar{position:fixed;left:0;right:0;bottom:0;top:auto;height:auto;min-height:0;z-index:30;padding:8px}.sidebar-top,.sidebar-bottom{display:none}.sidebar nav{margin:0;display:grid;grid-template-columns:repeat(7,1fr);gap:4px;overflow-x:auto}.nav{display:grid;justify-items:center;gap:2px;padding:8px 5px}.nav b{display:block;font-size:10px}.main{padding-bottom:82px}.topbar{padding:18px 16px 12px;align-items:flex-start;flex-direction:column}.top-actions{width:100%;flex-wrap:wrap}.view{padding:0 12px 28px}.grid.two,.grid.three,.two-col,.stats-grid{grid-template-columns:1fr}.data-row{grid-template-columns:34px 1fr}.data-cell{grid-column:2}.data-label{display:block}.row-actions{grid-column:2}.metric-grid{grid-template-columns:1fr}.card{padding:17px}.toast-host{left:12px;right:12px;top:12px}}

/* Dashboard customization */
.dashboard-toolbar{display:flex;justify-content:space-between;gap:18px;align-items:center}
.dashboard-toolbar h2{margin-bottom:4px}
.dashboard-toolbar p{margin:0}
.dashboard-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-flow:dense;gap:16px}
.dashboard-widget{position:relative;min-width:0;transition:transform .18s ease,opacity .18s ease}
.dashboard-widget[data-size="small"]{grid-column:span 3;min-height:145px}
.dashboard-widget[data-size="medium"]{grid-column:span 4;min-height:180px}
.dashboard-widget[data-size="large"]{grid-column:span 6;min-height:240px}
.dashboard-widget[data-size="wide"]{grid-column:span 12;min-height:220px}


.dashboard-widget.dragging{opacity:.45;transform:scale(.99)}
.dashboard-widget .widget-content{height:100%}
.dashboard-widget.stat-card .widget-content{display:flex;flex-direction:column;justify-content:center}
.dashboard-widget.stat-card strong{font-size:clamp(28px,4vw,44px)}
.dashboard-widget[data-size="small"] .widget-content h2{font-size:17px}
@media(max-width:1100px){
  .dashboard-widget[data-size="small"]{grid-column:span 4}
  .dashboard-widget[data-size="medium"]{grid-column:span 6}
  .dashboard-widget[data-size="large"]{grid-column:span 6}
}
@media(max-width:760px){
  .dashboard-toolbar{align-items:flex-start;flex-direction:column}
  .dashboard-grid{grid-template-columns:1fr}
  .dashboard-widget[data-size]{grid-column:1!important;min-height:auto}
  }

/* Hover-to-move and live resize dashboard widgets */
.dashboard-widget{user-select:none}
.dashboard-widget .widget-handle{
  display:grid;
  position:absolute;
  left:10px;
  top:10px;
  width:34px;
  height:34px;
  place-items:center;
  border-radius:9px;
  background:var(--soft);
  color:var(--muted);
  cursor:move;
  z-index:3;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease,transform .15s ease;
}
.dashboard-widget .widget-handle::before{
  content:"↕";
  position:absolute;
  transform:rotate(45deg);
  font-size:18px;
  line-height:1;
}
.dashboard-widget:hover .widget-handle,
.dashboard-widget:focus-within .widget-handle{
  opacity:1;
  pointer-events:auto;
}
.dashboard-widget:hover .widget-content{padding-top:38px}
.dashboard-widget .widget-resize-handle{
  position:absolute;
  right:6px;
  bottom:6px;
  width:20px;
  height:20px;
  opacity:0;
  pointer-events:none;
  cursor:nwse-resize;
  z-index:3;
  border-right:3px solid var(--muted);
  border-bottom:3px solid var(--muted);
  border-radius:0 0 5px 0;
  transition:opacity .15s ease;
}
.dashboard-widget:hover .widget-resize-handle,
.dashboard-widget:focus-within .widget-resize-handle{
  opacity:.8;
  pointer-events:auto;
}
.dashboard-widget.resizing{
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.dashboard-widget.dragging{cursor:grabbing}
@media(max-width:760px){
  .dashboard-widget .widget-handle,
  .dashboard-widget .widget-resize-handle{
    opacity:1;
    pointer-events:auto;
  }
  .dashboard-widget:hover .widget-content{padding-top:38px}
}

:root{--user-accent:#0f2f49}.topbar,.price-card{background:linear-gradient(145deg,var(--user-accent),color-mix(in srgb,var(--user-accent) 70%, white));}.btn.primary{background:var(--user-accent)}.brand-mark{background:var(--user-accent)}
.color-setting{display:grid;gap:10px}
.setting-label{font-size:13px;font-weight:750}
.color-swatches{display:flex;gap:9px;flex-wrap:wrap}
.color-swatch{width:34px;height:34px;border-radius:10px;border:3px solid transparent;background:var(--swatch);cursor:pointer;box-shadow:0 0 0 1px rgba(0,0,0,.12)}
.color-swatch.active{border-color:var(--panel);box-shadow:0 0 0 3px var(--text)}
.custom-color-label{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)}
.custom-color-label input[type=color]{width:46px;height:34px;padding:2px;border-radius:8px}
#accentColorValue{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.sidebar{background:var(--user-accent)!important}
.sidebar .nav:hover,.sidebar .nav.active{background:color-mix(in srgb,var(--user-accent) 72%, white)!important}
.sidebar .icon-btn{background:color-mix(in srgb,var(--user-accent) 82%, black)!important}

:root{
  --user-background:#0f2f49;
  --user-menu:#0f2f49;
  --user-text:#152230;
}
body{background:var(--bg)!important;color:var(--user-text)!important}
.main,.view{color:var(--user-text)}
.sidebar{background:var(--user-menu)!important}
.sidebar .nav:hover,.sidebar .nav.active{background:color-mix(in srgb,var(--user-menu) 72%, white)!important}
.sidebar .icon-btn{background:color-mix(in srgb,var(--user-menu) 82%, black)!important}
.topbar h1,.topbar p,.card,.stat-card,.dashboard-toolbar{color:var(--user-text)}
.theme-color-group{display:grid;gap:18px}
.color-setting{padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
/* Preserve input field colors regardless of theme color selections */
input,select,textarea{
  background:var(--panel)!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
}

/* Apply the selected background color to the application, not the browser canvas */
.app{background:var(--user-background)!important}
.main{background:var(--user-background)!important}
.view{background:transparent!important}
.topbar{background:transparent!important}
.sidebar{background:var(--user-menu)!important}

/* Cards and input fields keep their own surfaces */
.card,.stat-card,.dashboard-toolbar,.modal-card,.auth-card{
  background:var(--panel)!important;
}
input,select,textarea{
  background:var(--panel)!important;
  color:var(--text)!important;
}

:root{--user-app-color:#0f2f49}
.app,.main{background:var(--user-app-color)!important}
.sidebar{background:var(--user-app-color)!important}
.sidebar .nav:hover,.sidebar .nav.active{
  background:color-mix(in srgb,var(--user-app-color) 72%, white)!important;
}
.sidebar .icon-btn{
  background:color-mix(in srgb,var(--user-app-color) 82%, black)!important;
}

.custom-color-label{display:none!important;}

.quotation-list{display:grid;gap:10px}
.quotation-row{display:grid;grid-template-columns:42px minmax(180px,1.4fr) minmax(120px,.8fr) minmax(90px,.55fr) minmax(110px,.7fr) auto;gap:12px;align-items:center;padding:14px;border:1px solid var(--line);border-radius:13px;background:var(--panel)}
.quotation-row.dragging{opacity:.45}.quotation-main strong{display:block}.quotation-main small{display:block;color:var(--muted);margin-top:3px}.quotation-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
@media(max-width:760px){.quotation-row{grid-template-columns:34px 1fr}.quotation-row>div:not(.drag-handle){grid-column:2}.quotation-actions{justify-content:flex-start}}

.advanced-color-controls{display:grid;gap:12px;margin-top:12px}
.color-mode-panel{padding:12px;border:1px dashed var(--line);border-radius:10px}
.gradient-preview{height:54px;border-radius:10px;border:1px solid var(--line);margin-top:10px}

:root{--user-app-background:#0f2f49}
.app,.main,.sidebar{background:var(--user-app-background)!important}

.gradient-total{display:flex;align-items:end;padding:0 0 8px;font-size:13px;color:var(--muted)}
input[type="range"]{padding:0!important;accent-color:var(--user-app-color)}

/* Modern layout refresh */
:root{
  --radius-sm:12px;
  --radius-md:16px;
  --radius-lg:22px;
  --surface-glass:rgba(255,255,255,.92);
}
body{letter-spacing:-.01em}
.topbar{padding:28px 32px 20px}
.topbar h1{font-size:clamp(28px,3vw,38px);letter-spacing:-.035em}
.topbar p{font-size:14px}
.view{padding:0 32px 46px}
.card,.stat-card{border-radius:var(--radius-lg);padding:24px}
.card-head{margin-bottom:22px}
.card-head h2{font-size:20px;letter-spacing:-.02em}
.card-head p{margin:5px 0 0;font-size:13px}
.grid{gap:16px}
label{font-size:12px;text-transform:none;letter-spacing:0}
input,select,textarea{min-height:46px;border-radius:12px;padding:12px 14px;transition:border-color .18s,box-shadow .18s,transform .18s}
input:focus,select:focus,textarea:focus{box-shadow:0 0 0 4px rgba(29,111,139,.12)}
.btn{min-height:42px;border-radius:12px;padding:11px 16px;transition:transform .16s,box-shadow .16s,opacity .16s}
.btn:hover{transform:translateY(-1px)}
.btn.primary{box-shadow:0 8px 18px rgba(15,47,73,.18)}
.sidebar{padding:22px 14px}
.nav{border-radius:13px;padding:13px 14px}
.nav span{font-size:18px}
.sidebar-bottom{padding-top:18px}
.price-card{border:none}
.metric-grid{gap:12px}
.metric-grid div{padding:12px;border-radius:12px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.08)}
.metrics div{padding:12px 0}
.details-body{padding-top:4px}
details{padding-top:18px}
summary{font-size:14px}
.profile-preview{border:none}
.logo-frame{min-height:100px}
.data-row,.quotation-row{border-radius:16px;padding:14px 16px}
.data-row:hover,.quotation-row:hover{box-shadow:0 10px 24px rgba(15,47,73,.07);transform:translateY(-1px)}
.modal-card{border-radius:24px;padding:26px}
.auth-card{border-radius:28px;padding:30px}
.auth-tabs{border-radius:14px}
.auth-tab{border-radius:10px}
.toast{border-radius:14px;padding:13px 16px}
.settings-layout{display:grid;gap:20px}
.settings-card{overflow:hidden}
.settings-section{display:grid;gap:18px}
.settings-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.settings-actions-card{display:flex;align-items:center;justify-content:space-between;gap:20px}
.theme-color-group{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.color-setting{border-radius:16px;padding:18px}
.color-swatches{gap:10px}
.color-swatch{width:38px;height:38px;border-radius:12px;transition:transform .15s,box-shadow .15s}
.color-swatch:hover{transform:scale(1.05)}
.color-mode-panel{border-radius:12px;background:var(--soft);border-style:solid}
.gradient-preview{height:64px;border-radius:14px}
.range-value{font-size:12px;color:var(--muted);font-weight:700}
.gradient-total{align-self:end;min-height:46px;padding:0 12px;display:flex;align-items:center;justify-content:space-between;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.dashboard-toolbar{border-radius:20px}
.dashboard-grid{gap:18px}
.dashboard-widget{border-radius:20px}
.quotation-list,.data-list{gap:12px}
@media(max-width:1100px){
  .settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .theme-color-group{grid-template-columns:1fr}
  .view{padding-inline:22px}
  .topbar{padding-inline:22px}
}
@media(max-width:760px){
  .topbar{padding:18px 14px 12px}
  .view{padding:0 12px 30px}
  .card,.stat-card{padding:18px;border-radius:18px}
  .settings-grid{grid-template-columns:1fr}
  .settings-actions-card{align-items:flex-start;flex-direction:column}
  .settings-actions-card .row{width:100%}
  .settings-actions-card .btn{flex:1}
  .theme-color-group{grid-template-columns:1fr}
}
.input-with-action{display:grid;grid-template-columns:1fr auto;gap:8px}.opportunity-number{font-family:ui-monospace,monospace;font-weight:700}.status-pill{display:inline-flex;padding:5px 9px;border-radius:999px;background:var(--soft);font-size:11px;font-weight:800}.status-pill.won{background:#dcfce7;color:#166534}.status-pill.lost{background:#fee2e2;color:#991b1b}.status-pill.open{background:#dbeafe;color:#1d4ed8}.status-pill.delayed{background:#fef3c7;color:#92400e}.status-pill.none{background:var(--soft);color:var(--muted)}
/* Solid colors only */
.advanced-color-controls,
#gradientColorControls,
#solidColorControls,
.gradient-preview,
.gradient-total{
  display:none!important;
}
.custom-color-card{
  display:grid;
  grid-template-columns:48px 1fr auto auto;
  gap:12px;
  align-items:center;
  margin-top:14px;
  padding:13px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:var(--soft);
}
.custom-color-preview{
  width:48px;
  height:48px;
  border-radius:13px;
  background:var(--user-app-color);
}
.hex-value{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:12px;
  font-weight:700;
  color:var(--muted);
}

.clickable-color-card{
  position:relative;
  grid-template-columns:1fr auto;
  cursor:pointer;
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
.clickable-color-card:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(15,47,73,.08);
  border-color:var(--accent);
}
.clickable-color-card::after{
  content:"Choose";
  padding:7px 10px;
  border-radius:9px;
  background:var(--panel);
  border:1px solid var(--line);
  color:var(--text);
  font-size:11px;
  font-weight:800;
}
.clickable-color-card input[type="color"]{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  opacity:0!important;
  cursor:pointer!important;
  padding:0!important;
  border:0!important;
}
.clickable-color-card .hex-value{
  margin-right:70px;
}
.custom-color-preview{display:none!important}
@media(max-width:760px){
  .clickable-color-card{
    grid-template-columns:1fr auto;
  }
  .clickable-color-card .hex-value{
    grid-column:auto;
    margin-right:60px;
  }
}

.color-setting[data-color-setting="app"],
.color-setting[data-color-setting="text"]{
  display:grid;
  gap:12px;
}
.color-setting[data-color-setting="app"] .color-swatches,
.color-setting[data-color-setting="text"] .color-swatches{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
}
.color-setting[data-color-setting="app"] .clickable-color-card,
.color-setting[data-color-setting="text"] .clickable-color-card{
  min-height:72px;
}


/* Equal width for both color selector sections */
.color-setting[data-color-setting="app"],
.color-setting[data-color-setting="text"]{
  width:100%;
}

.color-setting[data-color-setting="app"] .color-swatches,
.color-setting[data-color-setting="text"] .color-swatches{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  width:100%;
}

.color-setting[data-color-setting="app"] .color-swatch,
.color-setting[data-color-setting="text"] .color-swatch{
  width:100%;
  aspect-ratio:1;
  max-width:none;
  height:auto;
}

.color-setting[data-color-setting="app"] .clickable-color-card,
.color-setting[data-color-setting="text"] .clickable-color-card{
  width:100%;
}

@media (max-width:900px){
  .color-setting[data-color-setting="app"] .color-swatches,
  .color-setting[data-color-setting="text"] .color-swatches{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:600px){
  .color-setting[data-color-setting="app"] .color-swatches,
  .color-setting[data-color-setting="text"] .color-swatches{
    grid-template-columns:1fr;
  }
}

/* Compact Settings redesign */
.settings-shell{display:grid;gap:16px;padding-bottom:96px}
.settings-panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.settings-panel-head{
  padding:18px 20px 14px;
  border-bottom:1px solid var(--line);
}
.settings-panel-head h2{margin:0;font-size:18px;letter-spacing:-.02em}
.settings-panel-head p{margin:4px 0 0;color:var(--muted);font-size:12px}
.settings-row{
  display:grid;
  grid-template-columns:minmax(180px,.55fr) minmax(0,1.45fr);
  gap:22px;
  align-items:center;
  padding:14px 20px;
  border-bottom:1px solid var(--line);
}
.settings-row:last-child{border-bottom:0}
.settings-label strong,.settings-label small{display:block}
.settings-label strong{font-size:13px}
.settings-label small{margin-top:3px;color:var(--muted);font-size:11px;line-height:1.35}
.settings-control{min-width:0}
.compact-control{max-width:320px}
.settings-grid.compact-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  padding:18px 20px 20px;
}
.discount-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.settings-grid.compact-grid label{font-size:11px}
.settings-grid.compact-grid input,
.settings-grid.compact-grid select,
.compact-control select{
  min-height:40px;
  padding:9px 11px;
  border-radius:10px;
}
.compact-swatches{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.compact-swatch{
  width:28px!important;
  height:28px!important;
  min-width:28px;
  border-radius:8px;
  border:2px solid transparent;
  background:var(--swatch);
  cursor:pointer;
  box-shadow:0 0 0 1px rgba(0,0,0,.12);
  transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease;
}
.compact-swatch:hover{transform:scale(1.08)}
.compact-swatch.active{
  border-color:var(--panel);
  box-shadow:0 0 0 3px var(--text);
}
.compact-custom-color{
  position:relative;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--soft);
  cursor:pointer;
  font-size:11px;
  font-weight:800;
}
.compact-custom-color:hover{border-color:var(--accent)}
.compact-custom-color input[type="color"]{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  opacity:0!important;
  cursor:pointer!important;
  padding:0!important;
  border:0!important;
}
.compact-custom-color .hex-value{
  font-size:10px;
  font-weight:700;
  color:var(--muted);
}
.settings-action-bar{
  position:sticky;
  bottom:12px;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-top:18px;
  padding:14px 16px;
  background:color-mix(in srgb,var(--panel) 92%, transparent);
  backdrop-filter:blur(16px);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 14px 36px rgba(15,47,73,.14);
}
.settings-action-bar strong,.settings-action-bar small{display:block}
.settings-action-bar small{margin-top:2px;color:var(--muted);font-size:11px}
@media(max-width:1100px){
  .settings-grid.compact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .discount-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  .settings-row{grid-template-columns:1fr;gap:10px;padding:14px 16px}
  .settings-grid.compact-grid,.discount-grid{grid-template-columns:1fr!important;padding:14px 16px 16px}
  .settings-action-bar{align-items:flex-start;flex-direction:column;bottom:8px}
  .settings-action-bar .row{width:100%}
  .settings-action-bar .btn{flex:1}
}

/* Forecast */
.forecast-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.forecast-layout{display:grid;grid-template-columns:minmax(320px,.7fr) minmax(0,1.3fr);gap:20px;align-items:start}
.forecast-filter-head{align-items:end}
.forecast-sort{min-width:240px}
.forecast-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.filter-chip{position:relative;display:inline-flex;cursor:pointer}
.filter-chip input{position:absolute;opacity:0;pointer-events:none}
.filter-chip span{display:inline-flex;align-items:center;min-height:34px;padding:7px 12px;border:1px solid var(--line);border-radius:999px;background:var(--panel);font-size:12px;font-weight:800;color:var(--muted)}
.filter-chip input:checked+span{background:var(--soft);border-color:var(--accent);color:var(--text);box-shadow:0 0 0 2px rgba(29,111,139,.08)}
.forecast-list{display:grid;gap:10px}
.forecast-row{display:grid;grid-template-columns:minmax(190px,1.35fr) minmax(90px,.55fr) minmax(110px,.7fr) minmax(130px,.9fr) minmax(100px,.65fr) auto;gap:12px;align-items:center;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.forecast-row:hover{box-shadow:0 10px 24px rgba(15,47,73,.07)}
.forecast-main strong,.forecast-main small,.forecast-row small{display:block}
.forecast-main small,.forecast-row small{color:var(--muted);margin-top:3px;font-size:11px}
.forecast-actions{display:flex;gap:7px;justify-content:flex-end;flex-wrap:wrap}
.empty-state{display:grid;gap:5px;text-align:center;padding:34px;border:1px dashed var(--line);border-radius:14px;color:var(--muted)}
.stage-chart{display:grid;gap:14px}
.stage-chart.large{gap:18px}
.stage-chart-row{display:grid;grid-template-columns:150px minmax(100px,1fr) 100px;gap:12px;align-items:center}
.stage-chart-label{display:grid;grid-template-columns:10px 1fr;column-gap:8px;align-items:center}
.stage-chart-label strong{font-size:12px}
.stage-chart-label small{grid-column:2;color:var(--muted);font-size:10px}
.status-dot{width:9px;height:9px;border-radius:50%;background:#94a3b8}
.status-dot.open,.stage-chart-bar.open{background:#3b82f6}
.status-dot.won,.stage-chart-bar.won{background:#22c55e}
.status-dot.lost,.stage-chart-bar.lost{background:#ef4444}
.status-dot.delayed,.stage-chart-bar.delayed{background:#f59e0b}
.status-dot.none,.stage-chart-bar.none{background:#94a3b8}
.stage-chart-bar-track{height:12px;background:var(--soft);border-radius:999px;overflow:hidden}
.stage-chart-bar{height:100%;border-radius:999px;min-width:0;transition:width .25s ease}
.stage-chart-value{text-align:right;font-size:12px;font-weight:800}
.dashboard-widget[data-widget="opportunityStages"]{grid-column:span 12}
@media(max-width:1100px){
  .forecast-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .forecast-layout{grid-template-columns:1fr}
  .forecast-row{grid-template-columns:1fr 1fr 1fr}
  .forecast-main,.forecast-actions{grid-column:1/-1}
  .forecast-actions{justify-content:flex-start}
}
@media(max-width:760px){
  .forecast-summary-grid{grid-template-columns:1fr}
  .forecast-filter-head{align-items:flex-start;flex-direction:column}
  .forecast-sort{min-width:0;width:100%}
  .forecast-row{grid-template-columns:1fr}
  .forecast-main,.forecast-actions{grid-column:auto}
  .stage-chart-row{grid-template-columns:120px 1fr}
  .stage-chart-value{grid-column:2;text-align:left}
}

/* Persistent Nivo4 branding */
.nivo4-logo{
  display:inline-flex;
  align-items:baseline;
  justify-content:center;
  min-width:54px;
  padding:7px 9px;
  border-radius:12px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.16);
  line-height:1;
  letter-spacing:-.06em;
}
.auth-card .nivo4-logo{
  background:var(--user-app-color,#0f2f49);
  border-color:transparent;
}
.nivo4-word{
  font-size:15px;
  font-weight:900;
  color:#fff;
}
.nivo4-four{
  margin-left:2px;
  font-size:22px;
  font-weight:950;
  color:#68c4df;
}
.nivo4-logo.large{
  min-width:88px;
  padding:12px 14px;
  border-radius:16px;
  background:var(--user-app-color,#0f2f49);
}
.nivo4-logo.large .nivo4-word{font-size:22px}
.nivo4-logo.large .nivo4-four{font-size:31px}
.powered-by{
  display:flex;
  align-items:baseline;
  gap:5px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel);
  color:var(--muted);
  font-size:10px;
  white-space:nowrap;
}
.powered-by strong{
  color:var(--text);
  font-size:12px;
}
.app-footer{
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding:0 32px 24px;
  color:rgba(255,255,255,.72);
  font-size:11px;
}
.about-card{max-width:640px}
.about-brand{display:flex;align-items:center;gap:14px}
.about-brand h2{margin:0}
.about-brand p{margin:4px 0 0}
.about-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:18px;
}
.about-grid div{
  padding:14px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--soft);
}
.about-grid span,.about-grid strong{display:block}
.about-grid span{color:var(--muted);font-size:11px}
.about-grid strong{margin-top:4px;font-size:13px}
.about-copy{
  margin:18px 0 0;
  padding-top:16px;
  border-top:1px solid var(--line);
  line-height:1.55;
}
.sidebar .nivo4-logo{
  background:rgba(255,255,255,.08);
}
.app.collapsed .sidebar .nivo4-logo{
  min-width:48px;
  padding-inline:6px;
}
@media(max-width:760px){
  .powered-by{display:none}
  .app-footer{padding:0 16px 96px;flex-direction:column}
  .about-grid{grid-template-columns:1fr}
}

/* Official uploaded Nivo4 logo */
.nivo4-logo-image{
  display:block;
  width:72px;
  height:72px;
  object-fit:contain;
  border-radius:50%;
  background:#fff;
  flex:0 0 auto;
}
.auth-card .nivo4-logo-image{
  width:92px;
  height:92px;
}
.sidebar .nivo4-logo-image{
  width:58px;
  height:58px;
}
.about-brand .nivo4-logo-image{
  width:88px;
  height:88px;
}
.app.collapsed .sidebar .nivo4-logo-image{
  width:50px;
  height:50px;
}
@media(max-width:760px){
  .sidebar .nivo4-logo-image{
    width:34px;
    height:34px;
  }
}

/* Forecast redesign */
.forecast-hero{
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:flex-end;
  padding:4px 2px 2px;
}
.forecast-hero h2{margin:4px 0 6px;font-size:28px;letter-spacing:-.035em}
.forecast-hero p{margin:0;color:var(--muted)}
.eyebrow{display:block;font-size:10px;letter-spacing:.12em;text-transform:uppercase;font-weight:900;color:var(--muted)}
.forecast-summary-grid{margin-top:18px}
.forecast-kpi{
  display:flex;
  align-items:center;
  gap:14px;
  min-height:116px;
  padding:18px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
}
.forecast-kpi-icon{
  width:48px;height:48px;min-width:48px;
  display:grid;place-items:center;border-radius:15px;
  font-size:21px;font-weight:900;
}
.forecast-kpi-icon.open{background:#dbeafe;color:#2563eb}
.forecast-kpi-icon.won{background:#dcfce7;color:#16a34a}
.forecast-kpi-icon.total{background:#ede9fe;color:#7c3aed}
.forecast-kpi-icon.average{background:#fef3c7;color:#d97706}
.forecast-kpi span,.forecast-kpi strong,.forecast-kpi small{display:block}
.forecast-kpi span{font-size:11px;color:var(--muted);font-weight:800}
.forecast-kpi strong{margin-top:4px;font-size:24px;letter-spacing:-.03em}
.forecast-kpi small{margin-top:3px;color:var(--muted);font-size:10px}
.forecast-top-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:20px}
.forecast-chart-card,.forecast-actions-card{min-height:360px}
.modern-stage-chart .stage-chart-row{grid-template-columns:150px 1fr 110px;padding:7px 0}
.modern-stage-chart .stage-chart-bar-track{height:14px}
.upcoming-actions{display:grid;gap:8px}
.upcoming-action{
  width:100%;display:grid;grid-template-columns:78px 1fr auto;
  gap:12px;align-items:center;padding:12px;border:1px solid var(--line);
  border-radius:13px;background:var(--panel);color:var(--text);text-align:left;cursor:pointer;
  transition:transform .15s,box-shadow .15s,border-color .15s;
}
.upcoming-action:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(15,47,73,.08);border-color:var(--accent)}
.upcoming-date{font-size:10px;font-weight:900;color:var(--muted)}
.upcoming-copy strong,.upcoming-copy small{display:block}
.upcoming-copy strong{font-size:12px}
.upcoming-copy small{margin-top:3px;color:var(--muted);font-size:10px}
.upcoming-arrow{font-size:22px;color:var(--muted)}
.forecast-table-card{overflow:hidden}
.forecast-toolbar{
  display:flex;justify-content:space-between;gap:22px;align-items:end;
  padding-bottom:18px;border-bottom:1px solid var(--line);
}
.forecast-toolbar h2{margin:3px 0 4px}
.forecast-toolbar p{margin:0;color:var(--muted)}
.forecast-toolbar-controls{display:flex;gap:12px;align-items:end}
.forecast-search{min-width:260px}
.forecast-sort{min-width:230px}
.forecast-toolbar-controls label span{display:block;margin-bottom:6px;font-size:10px;color:var(--muted);font-weight:900;text-transform:uppercase;letter-spacing:.08em}
.forecast-filter-bar{
  display:flex;justify-content:space-between;gap:14px;align-items:center;
  padding:14px 0;border-bottom:1px solid var(--line);
}
.result-count{font-size:11px;color:var(--muted);font-weight:800}
.chip-dot{width:7px;height:7px;border-radius:50%;display:inline-block;margin-right:6px}
.chip-dot.open{background:#3b82f6}.chip-dot.won{background:#22c55e}.chip-dot.lost{background:#ef4444}.chip-dot.delayed{background:#f59e0b}.chip-dot.none{background:#94a3b8}
.forecast-table-head{
  display:grid;
  grid-template-columns:minmax(190px,1.35fr) minmax(90px,.55fr) minmax(110px,.7fr) minmax(130px,.9fr) minmax(100px,.65fr) auto;
  gap:12px;padding:12px 14px 8px;
  color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:900;
}
.forecast-list{gap:0}
.forecast-row{
  border:0;border-top:1px solid var(--line);border-radius:0;padding:15px 14px;
  transition:background .15s;
}
.forecast-row:hover{box-shadow:none;transform:none;background:var(--soft)}
.forecast-title-line{display:flex;gap:10px;align-items:center;justify-content:space-between}
.forecast-score-date{font-size:9px;color:var(--muted);white-space:nowrap}
.forecast-next-action strong{display:block;font-size:12px}
.empty-state.compact{padding:24px}
@media(max-width:1100px){
  .forecast-top-grid{grid-template-columns:1fr}
  .forecast-toolbar{align-items:flex-start;flex-direction:column}
  .forecast-toolbar-controls{width:100%}
  .forecast-search,.forecast-sort{min-width:0;flex:1}
  .forecast-table-head{display:none}
  .forecast-row{border:1px solid var(--line);border-radius:14px;margin-top:10px}
}
@media(max-width:760px){
  .forecast-hero{align-items:flex-start;flex-direction:column}
  .forecast-hero-actions,.forecast-hero-actions .btn{width:100%}
  .forecast-toolbar-controls{flex-direction:column}
  .forecast-search,.forecast-sort{width:100%}
  .forecast-filter-bar{align-items:flex-start;flex-direction:column}
  .forecast-kpi{min-height:96px}
  .modern-stage-chart .stage-chart-row{grid-template-columns:110px 1fr}
}

/* About button follows the selected app/menu color */
#aboutBtn{
  background:var(--user-app-color,#0f2f49)!important;
  border-color:var(--user-app-color,#0f2f49)!important;
  color:#fff!important;
  box-shadow:0 6px 14px color-mix(in srgb,var(--user-app-color,#0f2f49) 28%, transparent);
}
#aboutBtn:hover{
  background:color-mix(in srgb,var(--user-app-color,#0f2f49) 84%, white)!important;
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 84%, white)!important;
  color:#fff!important;
}
#aboutBtn:active{
  background:color-mix(in srgb,var(--user-app-color,#0f2f49) 84%, black)!important;
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 84%, black)!important;
}
#aboutBtn:focus-visible{
  outline:3px solid color-mix(in srgb,var(--user-app-color,#0f2f49) 35%, transparent);
  outline-offset:2px;
}

/* Profile photo and avatar */
.profile-media-preview{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  align-items:start;
  margin-bottom:18px;
}
.profile-media-item{display:grid;gap:8px;justify-items:center}
.profile-media-label{
  font-size:10px;
  color:var(--muted);
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.profile-photo-frame{
  width:112px;
  height:112px;
  position:relative;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:50%;
  border:1px solid var(--line);
  background:var(--soft);
  box-shadow:inset 0 0 0 5px var(--panel);
}
.profile-photo-frame img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.profile-photo-placeholder{
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  color:var(--muted);
}
.profile-photo-placeholder small{font-size:10px;font-weight:800}
.camera-icon{
  position:relative;
  display:block;
  width:38px;
  height:27px;
  border:3px solid currentColor;
  border-radius:7px;
}
.camera-icon::before{
  content:"";
  position:absolute;
  width:16px;
  height:7px;
  left:8px;
  top:-9px;
  border:3px solid currentColor;
  border-bottom:0;
  border-radius:5px 5px 0 0;
}
.camera-lens{
  position:absolute;
  width:12px;
  height:12px;
  left:10px;
  top:5px;
  border:3px solid currentColor;
  border-radius:50%;
}
.profile-upload-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:20px;
}
.profile-upload-card{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:14px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--soft);
}
.profile-upload-card h3{margin:0 0 4px;font-size:14px}
.profile-upload-card p{margin:0;color:var(--muted);font-size:11px;line-height:1.4}
.sidebar-user{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 9px;
  margin-bottom:8px;
  border-radius:13px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.1);
}
.sidebar-avatar-wrap{
  width:38px;
  height:38px;
  min-width:38px;
  border-radius:50%;
  overflow:hidden;
  background:rgba(255,255,255,.12);
}
.sidebar-avatar{
  width:100%;
  height:100%;
  object-fit:cover;
}
.sidebar-avatar-placeholder{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  position:relative;
}
.sidebar-avatar-placeholder::before{
  content:"";
  position:absolute;
  width:14px;
  height:14px;
  top:6px;
  border:2px solid #fff;
  border-radius:50%;
}
.sidebar-avatar-placeholder::after{
  content:"";
  position:absolute;
  width:22px;
  height:11px;
  bottom:5px;
  border:2px solid #fff;
  border-radius:12px 12px 5px 5px;
}
.camera-glyph{
  position:absolute;
  right:0;
  bottom:0;
  width:14px;
  height:14px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--user-app-color,#0f2f49);
  border:2px solid #fff;
  font-size:0;
}
.camera-glyph::before{
  content:"";
  width:7px;
  height:5px;
  border:1.5px solid #fff;
  border-radius:2px;
}
.sidebar-user-copy{min-width:0}
.sidebar-user-copy strong,.sidebar-user-copy span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-user-copy strong{font-size:12px;color:#fff}
.sidebar-user-copy span{margin-top:2px;font-size:10px;color:rgba(255,255,255,.7)}
.app.collapsed .sidebar-user-copy{display:none}
.app.collapsed .sidebar-user{justify-content:center;padding:8px 4px}
@media(max-width:760px){
  .profile-media-preview,.profile-upload-grid{grid-template-columns:1fr}
  .sidebar-user{display:none}
}

.profile-record-head{align-items:flex-start;gap:22px}.profile-media-controls{display:flex;gap:16px;margin-left:auto}.profile-media-control{position:relative;display:grid;justify-items:center;gap:7px}.profile-media-button{position:relative;width:68px;height:68px;padding:0;overflow:hidden;border:1px solid var(--line);border-radius:16px;background:var(--soft);cursor:pointer;box-shadow:0 5px 14px rgba(15,47,73,.08);transition:transform .15s,box-shadow .15s,border-color .15s}.profile-media-button.round{border-radius:50%}.profile-media-button:hover{transform:translateY(-2px);border-color:var(--accent);box-shadow:0 10px 22px rgba(15,47,73,.12)}.profile-media-button img{width:100%;height:100%;display:none;object-fit:cover}#profileLogoPreview{object-fit:contain;background:#fff}.profile-media-placeholder{width:100%;height:100%;display:grid;place-items:center}.logo-placeholder{font-size:20px;font-weight:900;color:var(--text)}.camera-placeholder{color:var(--muted)}.media-edit-badge{position:absolute;right:3px;bottom:3px;width:20px;height:20px;display:grid;place-items:center;border-radius:50%;background:var(--user-app-color,#0f2f49);color:#fff;border:2px solid var(--panel);font-size:10px;font-weight:900}.profile-media-caption{text-align:center}.profile-media-caption strong,.profile-media-caption span{display:block}.profile-media-caption strong{font-size:10px}.profile-media-caption span{margin-top:2px;font-size:9px;color:var(--muted)}.profile-media-menu{position:absolute;top:88px;right:0;z-index:40;display:none;min-width:142px;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:0 16px 34px rgba(15,47,73,.18)}.profile-media-menu.open{display:grid}.media-menu-item{position:relative;width:100%;padding:9px 10px;border:0;border-radius:8px;background:transparent;color:var(--text);text-align:left;font:inherit;font-size:11px;font-weight:750;cursor:pointer}.media-menu-item:hover{background:var(--soft)}.media-menu-item.danger{color:var(--danger)}.media-menu-item:disabled{opacity:.4;cursor:not-allowed}.media-menu-item input[type=file]{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0!important;cursor:pointer!important}.image-viewer-card{max-width:720px}.image-viewer-card img{width:100%;max-height:70vh;object-fit:contain;border-radius:14px;background:var(--soft)}.profile-upload-grid,.profile-media-preview{display:none!important}@media(max-width:900px){.profile-record-head{flex-direction:column}.profile-media-controls{width:100%;justify-content:flex-start;margin-left:0}}@media(max-width:560px){.profile-media-controls{justify-content:space-around}}

/* Integrated profile summary */
.profile-grid{
  grid-template-columns:1fr!important;
}
.profile-record-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:24px;
  align-items:center;
  padding:20px;
  margin-bottom:18px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--panel);
  box-shadow:var(--shadow);
}
.profile-summary-panel{
  min-width:0;
  padding:18px 20px;
  border-radius:18px;
  background:color-mix(in srgb,var(--user-app-color,#0f2f49) 10%, var(--panel));
}
.profile-summary-main h2{
  margin:0;
  font-size:32px;
  line-height:1.05;
  letter-spacing:-.04em;
}
.profile-summary-main p{
  margin:10px 0 0;
  font-size:17px;
  color:color-mix(in srgb,var(--user-app-color,#0f2f49) 36%, var(--muted));
  font-weight:700;
}
.profile-summary-details{
  display:grid;
  gap:8px;
  margin-top:20px;
}
.profile-summary-details span{
  display:block;
  color:color-mix(in srgb,var(--user-app-color,#0f2f49) 28%, var(--muted));
  font-size:14px;
  font-weight:650;
}
.profile-section-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:4px 0 16px;
}
.profile-section-heading h2{
  margin:0;
  font-size:18px;
}
.profile-section-heading p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
}
.profile-record-top .profile-media-controls{
  margin-left:0;
}
.profile-preview{display:none!important}
@media(max-width:900px){
  .profile-record-top{
    grid-template-columns:1fr;
    align-items:start;
  }
  .profile-record-top .profile-media-controls{
    width:100%;
    justify-content:flex-start;
  }
}
@media(max-width:560px){
  .profile-record-top{
    padding:14px;
  }
  .profile-summary-panel{
    padding:16px;
  }
  .profile-summary-main h2{
    font-size:25px;
  }
  .profile-summary-main p{
    font-size:15px;
  }
}


/* Premium UI refinement */
:root{
  --font-sans:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Inter","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-mono:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;
  --radius-xs:8px;
  --radius-sm:11px;
  --radius-md:15px;
  --radius-lg:20px;
  --radius-xl:26px;
  --shadow-soft:0 8px 24px rgba(15,23,42,.06);
  --shadow-card:0 14px 38px rgba(15,23,42,.08);
  --shadow-float:0 24px 60px rgba(15,23,42,.16);
}

*{box-sizing:border-box}

html{
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

body{
  font-family:var(--font-sans);
  font-size:14px;
  line-height:1.5;
  letter-spacing:-.005em;
}

button,input,select,textarea{
  font:inherit;
}

h1,h2,h3,h4,strong{
  letter-spacing:-.025em;
}

h1{
  font-size:clamp(28px,3vw,40px);
  line-height:1.08;
  font-weight:760;
}

h2{
  line-height:1.15;
  font-weight:730;
}

h3{
  line-height:1.2;
  font-weight:700;
}

p{
  line-height:1.6;
}

.main{
  min-width:0;
}

.topbar{
  min-height:92px;
  padding:24px 30px 20px;
  border-bottom:1px solid color-mix(in srgb,var(--line) 70%, transparent);
  backdrop-filter:blur(18px);
}

.topbar h1{
  margin:0;
}

.topbar p{
  margin:6px 0 0;
  font-size:13px;
  color:var(--muted);
}

.top-actions{
  gap:10px;
}

.view{
  padding:24px 30px 44px;
}

.section-gap{
  margin-top:20px;
}

.card,
.stat-card,
.settings-panel,
.forecast-kpi,
.dashboard-widget{
  border:1px solid color-mix(in srgb,var(--line) 84%, transparent);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-soft);
}

.card{
  padding:22px;
}

.card:hover,
.forecast-kpi:hover,
.dashboard-widget:hover{
  box-shadow:var(--shadow-card);
}

.card-head{
  gap:18px;
  margin-bottom:18px;
}

.card-head h2{
  margin:0;
  font-size:19px;
}

.card-head p{
  margin:5px 0 0;
  font-size:12px;
  color:var(--muted);
}

.sidebar{
  padding:20px 12px;
  box-shadow:10px 0 30px rgba(15,23,42,.08);
}

.brand{
  padding:4px 6px 18px;
  gap:12px;
}

.brand-copy strong{
  font-size:14px;
  font-weight:780;
}

.brand-copy span{
  margin-top:3px;
  font-size:10px;
  opacity:.72;
}

.nav-list{
  gap:5px;
}

.nav{
  min-height:44px;
  padding:10px 12px;
  border-radius:12px;
  font-weight:650;
  letter-spacing:-.01em;
}

.nav span{
  width:22px;
  font-size:17px;
}

.nav b{
  font-size:12px;
}

.sidebar-bottom{
  gap:8px;
}

.sidebar-user{
  padding:10px;
  border-radius:14px;
}

.sidebar-user-copy strong{
  font-size:11px;
}

.sidebar-user-copy span{
  font-size:9px;
}

.btn{
  min-height:40px;
  padding:9px 14px;
  border-radius:10px;
  font-size:12px;
  font-weight:720;
  letter-spacing:-.01em;
  box-shadow:none;
}

.btn.small{
  min-height:34px;
  padding:7px 10px;
  font-size:11px;
}

.btn.primary{
  box-shadow:0 6px 16px color-mix(in srgb,var(--user-app-color,#0f2f49) 20%, transparent);
}

.btn:hover{
  transform:translateY(-1px);
}

.btn:active{
  transform:translateY(0);
}

input,
select,
textarea{
  min-height:42px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb,var(--line) 92%, transparent);
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}

textarea{
  min-height:100px;
  resize:vertical;
}

input:hover,
select:hover,
textarea:hover{
  border-color:color-mix(in srgb,var(--line) 55%, var(--text));
}

input:focus,
select:focus,
textarea:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%, transparent);
}

label{
  display:grid;
  gap:6px;
  font-size:11px;
  font-weight:680;
  color:var(--text);
}

.grid{
  gap:14px;
}

.grid.two{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.grid.three{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.metric-grid,
.forecast-summary-grid,
.dashboard-grid{
  gap:14px;
}

.stat-card{
  padding:18px;
}

.stat-card span{
  font-size:11px;
  font-weight:680;
}

.stat-card strong{
  margin-top:8px;
  font-size:25px;
}

.price-card{
  border-radius:var(--radius-xl);
  padding:24px;
  box-shadow:var(--shadow-card);
}

.metric-grid div{
  border-radius:12px;
  padding:12px;
}

.data-list,
.quotation-list,
.forecast-list{
  gap:10px;
}

.data-row,
.quotation-row,
.forecast-row{
  border-radius:14px;
  transition:background .15s ease,box-shadow .15s ease,transform .15s ease;
}

.data-row:hover,
.quotation-row:hover{
  transform:translateY(-1px);
}

.data-label{
  margin-bottom:4px;
  font-size:9px;
  font-weight:820;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.status-pill{
  padding:5px 9px;
  border-radius:999px;
  font-size:10px;
  font-weight:780;
}

.profile-record-top{
  padding:18px;
  gap:20px;
  border-radius:var(--radius-xl);
}

.profile-summary-panel{
  padding:20px;
  border-radius:18px;
}

.profile-summary-main h2{
  font-size:30px;
  font-weight:770;
}

.profile-summary-main p{
  margin-top:8px;
  font-size:15px;
}

.profile-summary-details{
  gap:7px;
  margin-top:18px;
}

.profile-summary-details span{
  font-size:13px;
}

.profile-media-button{
  width:64px;
  height:64px;
  border-radius:15px;
}

.profile-media-caption strong{
  font-size:9px;
  letter-spacing:.02em;
}

.profile-media-caption span{
  font-size:8px;
}

.profile-media-menu{
  border-radius:12px;
  box-shadow:var(--shadow-float);
}

.settings-shell{
  gap:14px;
}

.settings-panel{
  border-radius:18px;
}

.settings-panel-head{
  padding:16px 18px 13px;
}

.settings-panel-head h2{
  font-size:17px;
}

.settings-row{
  padding:13px 18px;
  gap:18px;
}

.settings-grid.compact-grid{
  padding:16px 18px 18px;
  gap:12px;
}

.compact-swatch{
  width:26px!important;
  height:26px!important;
  min-width:26px;
  border-radius:7px;
}

.compact-custom-color{
  min-height:32px;
  padding:5px 9px;
}

.settings-action-bar{
  padding:12px 14px;
  border-radius:14px;
  box-shadow:var(--shadow-card);
}

.forecast-hero{
  padding-top:0;
}

.forecast-hero h2{
  font-size:30px;
  font-weight:760;
}

.forecast-kpi{
  min-height:108px;
  padding:16px;
}

.forecast-kpi-icon{
  width:44px;
  height:44px;
  min-width:44px;
  border-radius:13px;
}

.forecast-kpi strong{
  font-size:22px;
}

.forecast-top-grid{
  gap:18px;
}

.forecast-chart-card,
.forecast-actions-card{
  min-height:340px;
}

.upcoming-action{
  padding:11px;
  border-radius:12px;
}

.forecast-toolbar{
  gap:18px;
  padding-bottom:16px;
}

.forecast-filter-bar{
  padding:12px 0;
}

.filter-chip span{
  min-height:32px;
  padding:6px 10px;
  font-size:11px;
}

.forecast-row{
  padding:14px 12px;
}

.modal-card{
  border-radius:var(--radius-xl);
  padding:24px;
  box-shadow:var(--shadow-float);
}

.auth-card{
  border-radius:28px;
  padding:28px;
  box-shadow:var(--shadow-float);
}

.toast{
  border-radius:12px;
  box-shadow:var(--shadow-float);
}

.app-footer{
  font-size:10px;
  opacity:.84;
}

@media(max-width:1100px){
  .topbar{
    padding-inline:22px;
  }
  .view{
    padding-inline:22px;
  }
  .grid.three{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:760px){
  body{
    font-size:13px;
  }
  .topbar{
    min-height:auto;
    padding:16px 14px 12px;
  }
  .topbar h1{
    font-size:26px;
  }
  .view{
    padding:16px 12px 32px;
  }
  .card{
    padding:17px;
    border-radius:17px;
  }
  .grid.two,
  .grid.three{
    grid-template-columns:1fr;
  }
  .profile-record-top{
    padding:14px;
  }
  .profile-summary-panel{
    padding:16px;
  }
  .profile-summary-main h2{
    font-size:24px;
  }
  .forecast-hero h2{
    font-size:25px;
  }
}

/* Refined navigation */
.nav-list{
  gap:2px!important;
}
.nav{
  min-height:38px!important;
  padding:7px 11px!important;
  border-radius:10px!important;
  font-weight:400!important;
}
.nav b{
  font-size:12px!important;
  font-weight:400!important;
  letter-spacing:0!important;
}
.nav span{
  font-size:16px!important;
}
.nav.active b{
  font-weight:520!important;
}
.sidebar-bottom{
  gap:4px!important;
}
.sidebar-user{
  margin-bottom:5px!important;
}
#logoutBtn{
  min-height:38px!important;
}

/* Polished opportunity graphs */
.stage-chart{
  display:block!important;
}
.opportunity-donut-layout{
  display:grid;
  grid-template-columns:minmax(170px,.75fr) minmax(220px,1.25fr);
  gap:26px;
  align-items:center;
}
.opportunity-donut-layout.large{
  grid-template-columns:minmax(210px,.8fr) minmax(260px,1.2fr);
}
.opportunity-donut{
  width:min(100%,230px);
  aspect-ratio:1;
  margin-inline:auto;
  display:grid;
  place-items:center;
  border-radius:50%;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.25),0 16px 36px rgba(15,23,42,.10);
}
.opportunity-donut-layout.large .opportunity-donut{
  width:min(100%,270px);
}
.opportunity-donut-center{
  width:62%;
  aspect-ratio:1;
  display:grid;
  place-content:center;
  text-align:center;
  border-radius:50%;
  background:var(--panel);
  box-shadow:0 8px 20px rgba(15,23,42,.08);
}
.opportunity-donut-center strong{
  font-size:30px;
  line-height:1;
}
.opportunity-donut-center span{
  margin-top:6px;
  font-size:10px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:760;
}
.opportunity-donut-center small{
  margin-top:5px;
  font-size:11px;
  color:var(--muted);
}
.opportunity-legend{
  display:grid;
  gap:8px;
}
.opportunity-legend-row{
  display:grid;
  grid-template-columns:10px 1fr auto;
  gap:10px;
  align-items:center;
  padding:9px 10px;
  border-radius:11px;
  transition:background .15s ease;
}
.opportunity-legend-row:hover{
  background:var(--soft);
}
.legend-dot{
  width:9px;
  height:9px;
  border-radius:50%;
}
.legend-copy strong,
.legend-copy small{
  display:block;
}
.legend-copy strong{
  font-size:11px;
  font-weight:680;
}
.legend-copy small{
  margin-top:2px;
  font-size:9px;
  color:var(--muted);
}
.legend-value{
  font-size:11px;
  font-weight:720;
}
.forecast-pipeline-trend{
  margin-top:22px;
}
.pipeline-trend-card{
  padding-top:18px;
  border-top:1px solid var(--line);
}
.pipeline-trend-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:10px;
}
.pipeline-trend-head strong,
.pipeline-trend-head small{
  display:block;
}
.pipeline-trend-head strong{
  font-size:12px;
}
.pipeline-trend-head small{
  margin-top:2px;
  font-size:9px;
  color:var(--muted);
}
.pipeline-trend-head>span{
  font-size:13px;
  font-weight:760;
}
.pipeline-trend-svg{
  width:100%;
  height:auto;
  overflow:visible;
}
.trend-axis{
  stroke:var(--line);
  stroke-width:1;
}
.trend-line{
  fill:none;
  stroke:var(--user-app-color);
  stroke-width:4;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.trend-point{
  fill:var(--panel);
  stroke:var(--user-app-color);
  stroke-width:3;
}
.trend-label{
  fill:var(--muted);
  font-size:10px;
  font-family:var(--font-sans);
}
@media(max-width:760px){
  .nav{
    min-height:36px!important;
  }
  .opportunity-donut-layout,
  .opportunity-donut-layout.large{
    grid-template-columns:1fr;
  }
  .opportunity-donut,
  .opportunity-donut-layout.large .opportunity-donut{
    width:min(100%,220px);
  }
}

/* Dashboard line graph */
.dashboard-line-graph{
  min-height:330px;
}
.line-chart-summary{
  display:flex;
  justify-content:flex-end;
  gap:24px;
  margin-bottom:4px;
}
.line-chart-summary div{
  text-align:right;
}
.line-chart-summary span,
.line-chart-summary strong{
  display:block;
}
.line-chart-summary span{
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  font-weight:760;
}
.line-chart-summary strong{
  margin-top:3px;
  font-size:14px;
}
.dashboard-line-svg{
  width:100%;
  height:auto;
  overflow:visible;
}
.line-chart-grid{
  stroke:var(--line);
  stroke-width:1;
  stroke-dasharray:4 5;
}
.line-chart-y-label,
.line-chart-x-label{
  fill:var(--muted);
  font-size:10px;
  font-family:var(--font-sans);
}
.dashboard-line-path{
  fill:none;
  stroke:var(--user-app-color);
  stroke-width:4;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.dashboard-line-point{
  fill:var(--panel);
  stroke:var(--user-app-color);
  stroke-width:3;
  transition:r .15s ease;
}
.dashboard-line-point:hover{
  r:7;
}

/* Forecast graphs side by side */
.forecast-top-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(300px,.38fr);
  gap:18px;
  align-items:start;
}
.forecast-graphs-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.forecast-graphs-grid .forecast-chart-card{
  min-height:390px;
}
.forecast-bars{
  height:280px;
  display:grid;
  grid-template-columns:repeat(5,minmax(48px,1fr));
  gap:14px;
  align-items:end;
  padding:8px 4px 0;
}
.forecast-bar-column{
  height:100%;
  display:grid;
  grid-template-rows:28px 1fr 32px;
  gap:7px;
  align-items:end;
  text-align:center;
}
.forecast-bar-value{
  min-height:28px;
  display:flex;
  justify-content:center;
  align-items:end;
  font-size:10px;
  font-weight:720;
  color:var(--muted);
}
.forecast-bar-track{
  width:min(54px,80%);
  height:100%;
  margin-inline:auto;
  display:flex;
  align-items:flex-end;
  border-radius:10px 10px 4px 4px;
  background:var(--soft);
  overflow:hidden;
}
.forecast-bar-fill{
  position:relative;
  width:100%;
  min-height:0;
  border-radius:9px 9px 3px 3px;
  transition:height .28s ease,filter .15s ease;
}
.forecast-bar-fill:hover{
  filter:brightness(1.08);
}
.forecast-bar-tooltip{
  position:absolute;
  left:50%;
  top:8px;
  transform:translateX(-50%);
  min-width:max-content;
  padding:4px 6px;
  border-radius:6px;
  background:rgba(15,23,42,.8);
  color:#fff;
  font-size:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease;
}
.forecast-bar-fill:hover .forecast-bar-tooltip{
  opacity:1;
}
.forecast-bar-label{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:5px;
  font-size:9px;
  font-weight:680;
  color:var(--muted);
}
.forecast-bar-label .legend-dot{
  width:7px;
  height:7px;
}

@media(max-width:1280px){
  .forecast-top-layout{
    grid-template-columns:1fr;
  }
}
@media(max-width:980px){
  .forecast-graphs-grid{
    grid-template-columns:1fr;
  }
}
@media(max-width:760px){
  .dashboard-line-graph{
    min-height:250px;
    overflow-x:auto;
  }
  .dashboard-line-svg{
    min-width:620px;
  }
  .line-chart-summary{
    justify-content:flex-start;
  }
  .forecast-bars{
    height:230px;
    gap:7px;
  }
  .forecast-bar-track{
    width:min(40px,84%);
  }
  .forecast-bar-value{
    font-size:8px;
  }
}

.chart-type-control{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:145px;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
}
.chart-type-control select{
  min-height:34px;
  padding:6px 28px 6px 9px;
  font-size:11px;
  text-transform:none;
  letter-spacing:0;
}
.dashboard-month-bars{
  height:270px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(44px,1fr));
  gap:12px;
  align-items:end;
}
.dashboard-month-bar{
  height:100%;
  display:grid;
  grid-template-rows:28px 1fr 28px;
  gap:5px;
  text-align:center;
}
.dashboard-month-track{
  height:100%;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  border-radius:9px 9px 3px 3px;
  background:var(--soft);
}
.dashboard-month-fill{
  width:min(42px,75%);
  border-radius:8px 8px 2px 2px;
  background:var(--user-app-color);
}
.dashboard-month-value,.dashboard-month-label{
  font-size:9px;
  color:var(--muted);
}
.stage-vertical-bars{
  height:270px;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:14px;
  align-items:end;
}
.stage-vertical-column{
  height:100%;
  display:grid;
  grid-template-rows:24px 1fr 25px;
  gap:6px;
  text-align:center;
}
.stage-vertical-track{
  height:100%;
  display:flex;
  align-items:flex-end;
  background:var(--soft);
  border-radius:9px 9px 3px 3px;
}
.stage-vertical-fill{
  width:100%;
  border-radius:8px 8px 2px 2px;
}
.stage-vertical-column strong,.stage-vertical-column span{
  font-size:10px;
}
.stage-horizontal-bars,.value-horizontal-bars{
  display:grid;
  gap:14px;
  padding-top:8px;
}
.stage-horizontal-row,.value-horizontal-row{
  display:grid;
  grid-template-columns:100px 1fr 90px;
  gap:12px;
  align-items:center;
}
.stage-horizontal-label{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:11px;
}
.stage-horizontal-track,.value-horizontal-track{
  height:12px;
  border-radius:999px;
  background:var(--soft);
  overflow:hidden;
}
.stage-horizontal-fill,.value-horizontal-fill{
  height:100%;
  border-radius:999px;
}
.stage-horizontal-row strong,.value-horizontal-row strong{
  text-align:right;
  font-size:11px;
}
.value-horizontal-row>span{
  font-size:11px;
}
.forecast-value-line{
  width:100%;
  height:auto;
}
.forecast-value-line-path{
  fill:none;
  stroke:var(--user-app-color);
  stroke-width:4;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.forecast-value-line-point{
  fill:var(--panel);
  stroke:var(--user-app-color);
  stroke-width:3;
}
@media(max-width:760px){
  .chart-type-control{
    width:100%;
    justify-content:space-between;
  }
  .stage-horizontal-row,.value-horizontal-row{
    grid-template-columns:80px 1fr 70px;
  }
}

/* Powered by Nivo4 replaces the About button */
.powered-by-button{
  appearance:none;
  cursor:pointer;
  min-height:38px;
  padding:8px 13px;
  font-family:inherit;
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease,background .15s ease;
}
.powered-by-button:hover{
  transform:translateY(-1px);
  border-color:var(--user-app-color,#0f2f49);
  box-shadow:0 7px 18px color-mix(in srgb,var(--user-app-color,#0f2f49) 18%, transparent);
}
.powered-by-button:active{
  transform:translateY(0);
}
.powered-by-button:focus-visible{
  outline:3px solid color-mix(in srgb,var(--user-app-color,#0f2f49) 22%, transparent);
  outline-offset:2px;
}

/* Shared Forecast pipeline trend */
.forecast-shared-trend-card{
  overflow:hidden;
}
.forecast-shared-trend{
  min-height:330px;
}
@media(max-width:760px){
  .powered-by-button{
    display:flex!important;
  }
  .forecast-shared-trend{
    min-height:250px;
    overflow-x:auto;
  }
}

/* Prominent Powered by Nivo4 button */
.powered-by-button{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:42px;
  padding:9px 16px!important;
  border:2px solid var(--user-app-color,#0f2f49)!important;
  border-radius:12px!important;
  background:var(--user-app-color,#0f2f49)!important;
  color:#fff!important;
  box-shadow:0 8px 20px color-mix(in srgb,var(--user-app-color,#0f2f49) 30%, transparent)!important;
  opacity:1!important;
}
.powered-by-button span{
  color:rgba(255,255,255,.78)!important;
  font-size:10px!important;
  font-weight:650!important;
  text-transform:uppercase;
  letter-spacing:.07em;
}
.powered-by-button strong{
  color:#fff!important;
  font-size:13px!important;
  font-weight:820!important;
}
.powered-by-button::after{
  content:"ⓘ";
  margin-left:3px;
  color:rgba(255,255,255,.88);
  font-size:14px;
}
.powered-by-button:hover{
  transform:translateY(-2px)!important;
  background:color-mix(in srgb,var(--user-app-color,#0f2f49) 88%, white)!important;
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 88%, white)!important;
  box-shadow:0 12px 28px color-mix(in srgb,var(--user-app-color,#0f2f49) 38%, transparent)!important;
}
.powered-by-button:active{
  transform:translateY(0)!important;
}

/* Dashboard uses the same polished forecast graph as Forecast */
.dashboard-forecast-graph{
  min-height:320px;
  display:grid!important;
  align-items:center;
}
.dashboard-widget[data-widget="opportunityStages"] .widget-content{
  min-height:100%;
}
@media(max-width:760px){
  .powered-by-button{
    width:auto!important;
    min-height:40px;
    padding:8px 12px!important;
  }
  .powered-by-button span{
    display:none;
  }
  .dashboard-forecast-graph{
    min-height:280px;
  }
}

/* Clickable quotation rows */
.clickable-quotation-row{
  cursor:pointer;
}
.clickable-quotation-row:hover{
  background:var(--soft);
  box-shadow:0 10px 24px rgba(15,23,42,.08);
}

/* External Quotes */
.external-quotes-hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:22px;
}
.external-quotes-hero h2{
  margin:4px 0 6px;
  font-size:30px;
}
.external-quotes-hero p{
  margin:0;
  color:var(--muted);
}
.external-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.external-list-head{
  align-items:end;
}
.external-search{
  min-width:280px;
}
.external-table-head,
.external-quote-row{
  display:grid;
  grid-template-columns:minmax(210px,1.3fr) minmax(150px,.9fr) minmax(110px,.65fr) minmax(100px,.6fr) minmax(110px,.65fr) auto;
  gap:14px;
  align-items:center;
}
.external-table-head{
  padding:11px 12px;
  color:var(--muted);
  font-size:9px;
  font-weight:820;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.external-quotes-list{
  display:grid;
}
.external-quote-row{
  padding:14px 12px;
  border-top:1px solid var(--line);
  cursor:pointer;
  transition:background .15s ease;
}
.external-quote-row:hover{
  background:var(--soft);
}
.external-quote-main strong,
.external-quote-main small,
.external-quote-row small{
  display:block;
}
.external-quote-main small,
.external-quote-row small{
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
}
.external-row-actions{
  display:flex;
  gap:6px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.status-pill.active{background:#dcfce7;color:#166534}
.status-pill.paused{background:#fef3c7;color:#92400e}
.status-pill.expired{background:#fee2e2;color:#991b1b}

/* External quote editor */
.external-quote-modal-card{
  max-width:860px;
}
.external-permissions h3{
  margin:0 0 10px;
  font-size:14px;
}
.permission-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.permission-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--soft);
}
.permission-toggle input{
  min-height:0;
}

/* Customer Portal */
.customer-portal-modal{
  padding:18px;
  overflow:auto;
  background:rgba(10,20,32,.76);
}
.customer-portal-shell{
  position:relative;
  width:min(1120px,100%);
  margin:auto;
  padding:28px;
  border-radius:28px;
  background:#f7f9fc;
  color:#172033;
  box-shadow:0 32px 90px rgba(0,0,0,.32);
}
.customer-portal-close{
  position:absolute;
  right:18px;
  top:18px;
  width:36px;
  height:36px;
  border:0;
  border-radius:50%;
  background:#e8edf5;
  color:#172033;
  font-size:22px;
  cursor:pointer;
}
.customer-portal-brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:28px;
}
.customer-portal-brand img{
  width:56px;
  height:56px;
  object-fit:contain;
  border-radius:14px;
  background:#fff;
}
.customer-portal-brand span,
.customer-portal-brand strong{
  display:block;
}
.customer-portal-brand span{
  font-size:10px;
  color:#6b7280;
  text-transform:uppercase;
  letter-spacing:.09em;
  font-weight:800;
}
.customer-portal-brand strong{
  margin-top:3px;
  font-size:18px;
}
.customer-portal-unlock{
  width:min(440px,100%);
  margin:60px auto 80px;
  padding:26px;
  border:1px solid #dce3ee;
  border-radius:20px;
  background:#fff;
  box-shadow:0 18px 50px rgba(31,50,79,.10);
}
.customer-portal-unlock h2{
  margin:0;
  font-size:24px;
}
.customer-portal-unlock p{
  margin:7px 0 20px;
  color:#6b7280;
}
.portal-error{
  display:block;
  min-height:20px;
  margin-top:10px;
  color:#b91c1c;
  font-size:11px;
}
.customer-portal-header{
  display:flex;
  justify-content:space-between;
  gap:22px;
  align-items:flex-start;
  margin-bottom:22px;
}
.customer-portal-header h1{
  margin:6px 0 8px;
  font-size:34px;
}
.customer-portal-header p{
  max-width:720px;
  margin:0;
  color:#687386;
}
.portal-quote-number{
  color:#64748b;
  font-size:10px;
  font-weight:820;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.portal-validity{
  min-width:150px;
  padding:12px 14px;
  border-radius:14px;
  background:#fff;
  border:1px solid #dce3ee;
}
.portal-validity span,
.portal-validity strong{
  display:block;
}
.portal-validity span{
  font-size:9px;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.portal-validity strong{
  margin-top:4px;
}
.customer-portal-grid{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr);
  gap:20px;
  align-items:start;
}
.portal-options-card,
.portal-price-card{
  padding:24px;
  border-radius:20px;
  background:#fff;
  border:1px solid #dce3ee;
  box-shadow:0 10px 30px rgba(31,50,79,.07);
}
.portal-options-card{
  display:grid;
  gap:15px;
}
.portal-options-card input,
.portal-options-card textarea{
  background:#fbfcfe;
  border-color:#dce3ee;
  color:#172033;
}
.portal-section-head h2{
  margin:0;
}
.portal-section-head p{
  margin:5px 0 4px;
  color:#6b7280;
  font-size:12px;
}
.portal-check-option{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px solid #dce3ee;
  border-radius:12px;
  background:#fbfcfe;
}
.portal-check-option input{
  min-height:0;
}
.portal-check-option strong,
.portal-check-option small{
  display:block;
}
.portal-check-option small{
  margin-top:3px;
  color:#6b7280;
}
.portal-price-card{
  position:sticky;
  top:18px;
}
.portal-price-card>span{
  display:block;
  color:#64748b;
  font-size:11px;
  font-weight:760;
}
.portal-price-card>strong{
  display:block;
  margin-top:7px;
  font-size:38px;
  letter-spacing:-.045em;
}
.portal-price-card>small{
  display:block;
  margin-top:3px;
  color:#64748b;
}
.portal-price-breakdown{
  display:grid;
  gap:10px;
  margin:20px 0;
  padding:16px 0;
  border-top:1px solid #e5eaf1;
  border-bottom:1px solid #e5eaf1;
}
.portal-price-breakdown div{
  display:flex;
  justify-content:space-between;
  gap:12px;
}
.portal-price-breakdown span{
  color:#64748b;
  font-size:11px;
}
.portal-price-breakdown strong{
  font-size:12px;
}
.portal-action-button{
  width:100%;
  margin-top:9px;
}
.portal-disclaimer{
  margin:14px 0 0;
  color:#7b8494;
  font-size:9px;
  line-height:1.5;
}
@media(max-width:1100px){
  .external-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .external-table-head{display:none}
  .external-quote-row{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:10px;border:1px solid var(--line);border-radius:14px}
  .external-quote-main,.external-row-actions{grid-column:1/-1}
  .external-row-actions{justify-content:flex-start}
}
@media(max-width:760px){
  .external-quotes-hero{align-items:flex-start;flex-direction:column}
  .external-quotes-hero .btn{width:100%}
  .external-kpi-grid{grid-template-columns:1fr}
  .external-list-head{align-items:flex-start;flex-direction:column}
  .external-search{min-width:0;width:100%}
  .external-quote-row{grid-template-columns:1fr}
  .external-quote-main,.external-row-actions{grid-column:auto}
  .permission-grid{grid-template-columns:1fr 1fr}
  .customer-portal-shell{padding:20px 14px;border-radius:20px}
  .customer-portal-header{flex-direction:column}
  .customer-portal-header h1{font-size:27px}
  .customer-portal-grid{grid-template-columns:1fr}
  .portal-price-card{position:static}
}

/* External Quote editor visibility and layout fix */
#externalQuoteModal{
  align-items:flex-start!important;
  justify-content:center!important;
  overflow-y:auto!important;
  padding:24px 16px!important;
}

.external-quote-modal-card{
  width:min(920px,100%)!important;
  max-width:920px!important;
  max-height:none!important;
  margin:auto!important;
  overflow:visible!important;
  padding:24px!important;
}

.external-quote-modal-card .card-head{
  position:sticky;
  top:-24px;
  z-index:12;
  margin:-24px -24px 20px;
  padding:22px 24px 16px;
  background:var(--panel);
  border-bottom:1px solid var(--line);
  border-radius:24px 24px 0 0;
}

.external-quote-modal-card .grid.two{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:16px!important;
  align-items:start!important;
}

.external-quote-modal-card label{
  min-width:0!important;
}

.external-quote-modal-card input,
.external-quote-modal-card select,
.external-quote-modal-card textarea{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}

.external-quote-modal-card .input-with-action{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:8px!important;
  align-items:center!important;
  min-width:0!important;
}

.external-quote-modal-card .input-with-action input{
  min-width:0!important;
}

.external-permissions{
  clear:both!important;
  width:100%!important;
}

.permission-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}

.permission-toggle{
  min-width:0!important;
  width:100%!important;
  align-items:center!important;
}

.permission-toggle span{
  min-width:0!important;
  white-space:normal!important;
  line-height:1.35!important;
}

.external-quote-modal-card textarea{
  min-height:120px!important;
}

.external-quote-modal-card .modal-actions{
  position:sticky;
  bottom:-24px;
  z-index:12;
  display:flex!important;
  justify-content:flex-end!important;
  gap:10px!important;
  margin:20px -24px -24px!important;
  padding:16px 24px!important;
  background:color-mix(in srgb,var(--panel) 96%, transparent)!important;
  backdrop-filter:blur(14px);
  border-top:1px solid var(--line)!important;
  border-radius:0 0 24px 24px!important;
}

.external-quote-modal-card .modal-actions .btn{
  flex:0 1 auto!important;
  white-space:nowrap!important;
}

@media(max-width:760px){
  #externalQuoteModal{
    padding:10px!important;
  }

  .external-quote-modal-card{
    width:100%!important;
    padding:18px!important;
    border-radius:18px!important;
  }

  .external-quote-modal-card .card-head{
    top:-18px;
    margin:-18px -18px 16px;
    padding:18px 18px 14px;
    border-radius:18px 18px 0 0;
  }

  .external-quote-modal-card .grid.two{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  .permission-grid{
    grid-template-columns:1fr!important;
  }

  .external-quote-modal-card .modal-actions{
    bottom:-18px;
    flex-direction:column!important;
    margin:18px -18px -18px!important;
    padding:14px 18px!important;
    border-radius:0 0 18px 18px!important;
  }

  .external-quote-modal-card .modal-actions .btn{
    width:100%!important;
  }
}

@media(max-height:720px){
  #externalQuoteModal{
    padding-top:8px!important;
    padding-bottom:8px!important;
  }

  .external-quote-modal-card{
    margin:0 auto!important;
  }
}

/* Improved readability for end-user editable options */
.external-permissions{
  padding:16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--soft);
}

.external-permissions h3{
  margin:0 0 4px!important;
  font-size:15px!important;
  font-weight:750!important;
  color:var(--text)!important;
}

.external-permissions h3::after{
  content:"Select which fields the customer may change.";
  display:block;
  margin-top:4px;
  font-size:11px;
  font-weight:500;
  line-height:1.4;
  color:var(--muted);
}

.permission-grid{
  margin-top:14px!important;
  gap:12px!important;
}

.permission-toggle{
  position:relative;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  min-height:58px!important;
  padding:12px 14px!important;
  border:1px solid var(--line)!important;
  border-radius:13px!important;
  background:var(--panel)!important;
  cursor:pointer!important;
  transition:border-color .15s ease,box-shadow .15s ease,background .15s ease,transform .15s ease;
}

.permission-toggle:hover{
  transform:translateY(-1px);
  border-color:var(--accent)!important;
  box-shadow:0 8px 18px rgba(15,23,42,.07);
}

.permission-toggle input[type="checkbox"]{
  appearance:none!important;
  -webkit-appearance:none!important;
  width:24px!important;
  height:24px!important;
  min-width:24px!important;
  min-height:24px!important;
  margin:0!important;
  padding:0!important;
  border:2px solid color-mix(in srgb,var(--line) 55%, var(--text))!important;
  border-radius:7px!important;
  background:var(--panel)!important;
  display:grid!important;
  place-items:center!important;
  cursor:pointer!important;
  box-shadow:none!important;
}

.permission-toggle input[type="checkbox"]::after{
  content:"";
  width:10px;
  height:6px;
  border-left:3px solid #fff;
  border-bottom:3px solid #fff;
  transform:rotate(-45deg) scale(0);
  transform-origin:center;
  transition:transform .12s ease;
  margin-top:-2px;
}

.permission-toggle input[type="checkbox"]:checked{
  background:var(--user-app-color,#0f2f49)!important;
  border-color:var(--user-app-color,#0f2f49)!important;
}

.permission-toggle input[type="checkbox"]:checked::after{
  transform:rotate(-45deg) scale(1);
}

.permission-toggle input[type="checkbox"]:focus-visible{
  outline:3px solid color-mix(in srgb,var(--user-app-color,#0f2f49) 22%, transparent)!important;
  outline-offset:2px;
}

.permission-toggle span{
  display:block!important;
  color:var(--text)!important;
  font-size:13px!important;
  font-weight:680!important;
  line-height:1.35!important;
}

.permission-toggle:has(input:checked){
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 58%, var(--line))!important;
  background:color-mix(in srgb,var(--user-app-color,#0f2f49) 7%, var(--panel))!important;
}

.permission-toggle:has(input:checked) span{
  color:var(--text)!important;
}

@media(max-width:760px){
  .external-permissions{
    padding:14px;
  }

  .permission-toggle{
    min-height:54px!important;
    padding:11px 12px!important;
  }

  .permission-toggle span{
    font-size:12px!important;
  }
}

/* Premium Interactive Price Quote */
.customer-portal-modal{
  background:
    radial-gradient(circle at top left,rgba(255,255,255,.08),transparent 34%),
    rgba(8,18,31,.82)!important;
}

.customer-portal-shell{
  width:min(1180px,100%)!important;
  padding:30px!important;
  border-radius:30px!important;
  background:linear-gradient(180deg,#f8fafc 0%,#f3f6fa 100%)!important;
}

.customer-portal-brand{
  margin-bottom:22px!important;
  padding-bottom:20px;
  border-bottom:1px solid #e1e7ef;
}

.customer-portal-brand img{
  width:62px!important;
  height:62px!important;
  border-radius:16px!important;
  box-shadow:0 8px 20px rgba(31,50,79,.1);
}

.customer-portal-brand strong{
  font-size:20px!important;
  letter-spacing:-.025em;
}

.portal-progress{
  display:flex;
  align-items:center;
  width:min(460px,100%);
  margin:0 auto 28px;
}

.portal-progress-step{
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  color:#8a94a5;
}

.portal-progress-step span{
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#e6ebf2;
  color:#64748b;
  font-size:11px;
  font-weight:800;
}

.portal-progress-step strong{
  font-size:11px;
  font-weight:700;
}

.portal-progress-step.active{
  color:#172033;
}

.portal-progress-step.active span{
  background:var(--user-app-color,#0f2f49);
  color:#fff;
  box-shadow:0 5px 14px color-mix(in srgb,var(--user-app-color,#0f2f49) 25%,transparent);
}

.portal-progress-line{
  flex:1;
  height:2px;
  margin:0 12px;
  background:#dfe5ed;
}

.customer-portal-header{
  padding:24px 26px;
  margin-bottom:20px!important;
  border:1px solid #dfe5ee;
  border-radius:20px;
  background:#fff;
  box-shadow:0 10px 28px rgba(31,50,79,.06);
}

.portal-heading-copy{
  min-width:0;
}

.customer-portal-header h1{
  margin:5px 0 8px!important;
  font-size:36px!important;
  line-height:1.08!important;
  letter-spacing:-.045em!important;
}

.customer-portal-header p{
  max-width:760px!important;
  line-height:1.6!important;
}

.portal-validity{
  min-width:176px!important;
  padding:15px 16px!important;
  border-radius:14px!important;
  background:#f7f9fc!important;
}

.customer-portal-grid{
  grid-template-columns:minmax(0,1.4fr) minmax(340px,.6fr)!important;
  gap:22px!important;
}

.portal-options-card,
.portal-price-card{
  border-radius:22px!important;
  border:1px solid #dfe5ed!important;
  box-shadow:0 14px 38px rgba(31,50,79,.07)!important;
}

.portal-options-card{
  padding:26px!important;
  gap:18px!important;
}

.portal-section-head>div{
  display:flex;
  align-items:flex-start;
  gap:12px;
}

.portal-section-number{
  width:32px;
  height:32px;
  min-width:32px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:var(--user-app-color,#0f2f49);
  color:#fff;
  font-size:12px;
  font-weight:800;
}

.portal-section-head h2{
  margin:0!important;
  font-size:20px;
}

.portal-section-head p{
  margin:5px 0 0!important;
}

.portal-product-summary{
  display:grid;
  gap:6px;
  padding:14px;
  border-radius:14px;
  background:#f7f9fc;
  border:1px solid #e0e6ee;
}

.portal-product-summary>span,
.portal-field-label{
  font-size:10px;
  font-weight:800;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.portal-product-summary input{
  min-height:38px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  font-size:16px!important;
  font-weight:720!important;
  color:#172033!important;
  box-shadow:none!important;
}

.portal-option-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.portal-field-card,
.portal-notes-card{
  display:grid!important;
  gap:8px!important;
  padding:15px!important;
  border:1px solid #dfe5ee!important;
  border-radius:14px!important;
  background:#fbfcfe!important;
}

.portal-field-card input,
.portal-notes-card textarea{
  width:100%;
  border-color:#d5dde8!important;
  background:#fff!important;
}

.portal-field-card small,
.portal-notes-card small{
  color:#7b8494;
  font-size:9px;
  line-height:1.4;
}

.portal-check-option.premium{
  position:relative;
  display:grid!important;
  grid-template-columns:auto auto 1fr;
  gap:12px!important;
  align-items:center!important;
  padding:16px!important;
  background:#fbfcfe!important;
  border:1px solid #dfe5ee!important;
  border-radius:14px!important;
}

.portal-check-option.premium input{
  position:absolute;
  opacity:0;
}

.portal-check-visual{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border:2px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
}

.portal-check-visual::after{
  content:"";
  width:11px;
  height:6px;
  border-left:3px solid #fff;
  border-bottom:3px solid #fff;
  transform:rotate(-45deg) scale(0);
  transition:transform .15s ease;
  margin-top:-2px;
}

.portal-check-option.premium input:checked+.portal-check-visual{
  background:var(--user-app-color,#0f2f49);
  border-color:var(--user-app-color,#0f2f49);
}

.portal-check-option.premium input:checked+.portal-check-visual::after{
  transform:rotate(-45deg) scale(1);
}

.portal-check-copy strong,
.portal-check-copy small{
  display:block;
}

.portal-check-copy strong{
  font-size:13px;
}

.portal-check-copy small{
  margin-top:3px;
  color:#6b7280;
  font-size:10px;
  line-height:1.45;
}

.portal-price-card{
  padding:24px!important;
  overflow:hidden;
}

.portal-price-top{
  padding:4px 0 20px;
  text-align:left;
}

.portal-price-top>span{
  display:block;
  font-size:10px;
  color:#64748b;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.portal-price-top>strong{
  display:block;
  margin-top:7px;
  font-size:42px;
  line-height:1;
  letter-spacing:-.05em;
  color:#172033;
}

.portal-price-top>small{
  display:block;
  margin-top:6px;
  color:#6b7280;
}

.portal-price-breakdown{
  margin:0!important;
  padding:18px 0!important;
}

.portal-price-breakdown div{
  align-items:center;
}

.portal-price-breakdown span{
  font-size:11px!important;
}

.portal-price-breakdown strong{
  font-size:12px!important;
}

.portal-action-section{
  display:grid;
  gap:10px;
  margin-top:18px;
}

.portal-action-eyebrow{
  display:block;
  margin-bottom:2px;
  font-size:9px;
  color:#64748b;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.portal-action-button{
  display:grid!important;
  grid-template-columns:34px 1fr;
  gap:10px;
  align-items:center;
  min-height:62px!important;
  margin-top:0!important;
  padding:11px 13px!important;
  text-align:left!important;
}

.portal-action-button>span:last-child strong,
.portal-action-button>span:last-child small{
  display:block;
}

.portal-action-button>span:last-child strong{
  font-size:12px;
}

.portal-action-button>span:last-child small{
  margin-top:3px;
  font-size:9px;
  opacity:.78;
  line-height:1.35;
}

.portal-action-icon{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:rgba(255,255,255,.15);
  font-size:15px;
}

.portal-trust-note{
  display:flex;
  gap:9px;
  align-items:flex-start;
  margin-top:15px;
  padding:12px;
  border-radius:12px;
  background:#f6f8fb;
  border:1px solid #e1e6ed;
}

.portal-trust-note p{
  margin:0;
  color:#70798a;
  font-size:9px;
  line-height:1.5;
}

.portal-lock-icon{
  color:var(--user-app-color,#0f2f49);
  font-size:10px;
}

.portal-footer{
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding:18px 4px 0;
  color:#8a94a5;
  font-size:9px;
}

@media(max-width:900px){
  .customer-portal-grid{
    grid-template-columns:1fr!important;
  }

  .portal-price-card{
    position:static!important;
  }
}

@media(max-width:640px){
  .customer-portal-shell{
    padding:16px!important;
    border-radius:20px!important;
  }

  .customer-portal-brand{
    padding-right:40px;
  }

  .portal-progress{
    margin-bottom:20px;
  }

  .portal-progress-step strong{
    display:none;
  }

  .customer-portal-header{
    padding:18px!important;
  }

  .customer-portal-header h1{
    font-size:27px!important;
  }

  .portal-option-grid{
    grid-template-columns:1fr;
  }

  .portal-options-card,
  .portal-price-card{
    padding:18px!important;
  }

  .portal-price-top>strong{
    font-size:36px;
  }

  .portal-footer{
    flex-direction:column;
  }
}

/* Forecast opportunity action dropdown */
.forecast-actions{position:relative;display:flex;justify-content:flex-end;overflow:visible}
.forecast-action-menu{position:relative}
.forecast-action-trigger{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  min-height:34px;padding:7px 11px;border:1px solid var(--line);
  border-radius:9px;background:var(--panel);color:var(--text);
  font:inherit;font-size:11px;font-weight:650;cursor:pointer;
  transition:border-color .15s,background .15s,box-shadow .15s
}
.forecast-action-trigger:hover{border-color:var(--accent);background:var(--soft);box-shadow:0 5px 14px rgba(15,23,42,.07)}
.forecast-action-chevron{font-size:13px;line-height:1;color:var(--muted)}
.forecast-action-dropdown{
  position:absolute;right:0;top:calc(100% + 6px);z-index:80;
  display:none;min-width:150px;padding:6px;border:1px solid var(--line);
  border-radius:12px;background:var(--panel);box-shadow:0 18px 42px rgba(15,23,42,.18)
}
.forecast-action-dropdown.open{display:grid}
.forecast-action-dropdown button{
  width:100%;min-height:35px;padding:8px 10px;border:0;border-radius:8px;
  background:transparent;color:var(--text);font:inherit;font-size:11px;
  font-weight:580;text-align:left;cursor:pointer
}
.forecast-action-dropdown button:hover{background:var(--soft)}
.forecast-action-dropdown button.danger{color:#b42318}
.forecast-action-dropdown button.danger:hover{background:#fef2f2;color:#991b1b}
.forecast-action-divider{height:1px;margin:5px 4px;background:var(--line)}
.forecast-list,.forecast-table-card,.forecast-row{overflow:visible!important}
@media(max-width:1100px){
  .forecast-actions{justify-content:flex-start}
  .forecast-action-dropdown{right:auto;left:0}
}

/* Pipeline is now the central opportunity workspace */
.legacy-quotes-view{
  display:none!important;
}

.pipeline-row-clickable{
  cursor:pointer;
}

.pipeline-row-clickable:hover{
  background:var(--soft);
}

.pipeline-row-clickable:focus-within{
  box-shadow:0 0 0 3px color-mix(in srgb,var(--user-app-color,#0f2f49) 14%, transparent);
}

/* Keep action controls above the clickable row */
.pipeline-row-clickable .forecast-action-menu,
.pipeline-row-clickable button{
  position:relative;
  z-index:2;
}

/* Negotiated External Quote pricing */
.field-help{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:9px;
  font-weight:500;
  line-height:1.4;
}

.portal-negotiated-price-info{
  display:grid;
  gap:4px;
  margin-top:13px;
  padding:11px 12px;
  border-radius:11px;
  background:#ecfdf3;
  border:1px solid #bbf7d0;
}

.portal-negotiated-price-info span{
  color:#64748b;
  font-size:10px;
  text-decoration:line-through;
}

.portal-negotiated-price-info strong{
  color:#15803d;
  font-size:11px;
}

#externalAgreedPrice:not(:placeholder-shown){
  border-color:var(--user-app-color,#0f2f49);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--user-app-color,#0f2f49) 12%,transparent);
}

/* Pipeline Actions menu foreground fix */
.forecast-table-card,
.forecast-list,
.forecast-row,
.pipeline-row-clickable,
.forecast-actions,
.forecast-action-menu{
  overflow:visible!important;
}

.forecast-table-card{
  position:relative;
  z-index:1;
}

.pipeline-row-clickable{
  position:relative;
  z-index:1;
}

.pipeline-row-clickable:has(.forecast-action-dropdown.open){
  z-index:5000;
}

.forecast-action-menu{
  z-index:5001;
}

.forecast-action-dropdown{
  position:fixed!important;
  right:auto!important;
  bottom:auto!important;
  z-index:2147483000!important;
  min-width:170px!important;
  isolation:isolate;
  border:1px solid color-mix(in srgb,var(--line) 75%, var(--text))!important;
  background:var(--panel)!important;
  box-shadow:0 24px 64px rgba(15,23,42,.28)!important;
  backdrop-filter:blur(18px);
}

.forecast-action-dropdown.open{
  display:grid!important;
  animation:forecastMenuIn .12s ease-out;
}

.forecast-action-dropdown::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  border-radius:12px;
  background:var(--panel);
}

.forecast-action-dropdown button{
  position:relative;
  z-index:1;
}

@keyframes forecastMenuIn{
  from{
    opacity:0;
    transform:translateY(-4px) scale(.98);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

/* Nivo4 Pricing Studio V3 rebuild */
.nav[data-view="quotes"],
.legacy-quotes-view{
  display:none!important;
}

#pipeline .forecast-list,
#pipeline .forecast-row,
#pipeline .forecast-table-card{
  overflow:visible!important;
}

.pipeline-row-clickable{
  cursor:pointer;
}

.pipeline-row-clickable:hover{
  background:var(--soft);
}

.forecast-action-dropdown{
  z-index:2147483000!important;
}

.card,
.dashboard-widget,
.forecast-kpi,
.settings-panel,
input,
select,
textarea{
  min-width:0;
}

/* External Quote negotiation and Pipeline synchronization */
.field-help{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:9px;
  font-weight:500;
  line-height:1.4;
}

.external-pricing-preview{
  display:grid;
  gap:4px;
  align-content:center;
  min-height:78px;
  padding:13px 15px;
  border:1px solid color-mix(in srgb,var(--user-app-color,#0f2f49) 32%,var(--line));
  border-radius:13px;
  background:color-mix(in srgb,var(--user-app-color,#0f2f49) 7%,var(--panel));
}

.external-pricing-preview span{
  font-size:9px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:800;
}

.external-pricing-preview strong{
  font-size:20px;
  letter-spacing:-.035em;
}

.external-pricing-preview small{
  color:var(--muted);
  font-size:9px;
  line-height:1.4;
}

.portal-negotiated-price-info{
  display:grid;
  gap:4px;
  margin-top:13px;
  padding:11px 12px;
  border-radius:11px;
  background:#ecfdf3;
  border:1px solid #bbf7d0;
}

.portal-negotiated-price-info span{
  color:#64748b;
  font-size:10px;
  text-decoration:line-through;
}

.portal-negotiated-price-info strong{
  color:#15803d;
  font-size:11px;
}

#externalAgreedPrice:not(:placeholder-shown){
  border-color:var(--user-app-color,#0f2f49);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--user-app-color,#0f2f49) 12%,transparent);
}

.external-negotiation-permissions{grid-column:1/-1;display:grid;gap:13px;padding:16px;border:1px solid var(--line);border-radius:15px;background:var(--soft)}
.external-negotiation-permissions h3{margin:0;font-size:14px}
.external-negotiation-permissions p{margin:4px 0 0;color:var(--muted);font-size:10px;line-height:1.5}
.negotiation-permission-grid{margin:0!important}
.portal-negotiation-panel{display:grid;gap:12px;margin-top:18px;padding:15px;border:1px solid color-mix(in srgb,var(--user-app-color,#0f2f49) 36%,#dfe5ed);border-radius:15px;background:color-mix(in srgb,var(--user-app-color,#0f2f49) 6%,#fff)}
.portal-negotiation-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.portal-negotiation-head span,.portal-negotiation-head strong{display:block}
.portal-negotiation-head>div>span{color:#64748b;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}
.portal-negotiation-head strong{margin-top:3px;font-size:13px}
.portal-maker-badge{padding:5px 8px;border-radius:999px;background:var(--user-app-color,#0f2f49);color:#fff;font-size:8px!important;font-weight:800;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap}
.portal-negotiation-field{display:grid!important;gap:7px!important;padding:12px!important;border:1px solid #dfe5ed!important;border-radius:12px!important;background:#fff!important}
.portal-negotiation-field>span{color:#64748b;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.07em}
.portal-negotiation-field small{color:#7b8494;font-size:9px;line-height:1.4}
.portal-negotiation-field input{width:100%;background:#fbfcfe!important;border-color:#d7dfe9!important;color:#172033!important}
.portal-negotiation-field .input-with-action{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.portal-negotiation-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.portal-negotiation-actions>span{color:#64748b;font-size:9px}
@media(max-width:640px){.portal-negotiation-head{flex-direction:column}.portal-negotiation-actions .btn{width:100%}.portal-negotiation-field .input-with-action{grid-template-columns:1fr}}

/* Stable layout rebuild additions */
.pipeline-status-filter{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:7px 11px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--muted);font:inherit;font-size:11px;font-weight:650;cursor:pointer}
.pipeline-status-filter:hover{border-color:var(--accent);background:var(--soft)}
.pipeline-status-filter.active{border-color:var(--accent);background:color-mix(in srgb,var(--user-app-color,#0f2f49) 10%,var(--panel));color:var(--text);box-shadow:0 0 0 2px color-mix(in srgb,var(--user-app-color,#0f2f49) 8%,transparent)}
.pipeline-status-filter b{min-width:19px;height:19px;display:grid;place-items:center;padding:0 5px;border-radius:999px;background:color-mix(in srgb,var(--muted) 12%,transparent);font-size:9px}
.pipeline-filter-actions{display:inline-flex;gap:4px;margin-left:6px}
.pipeline-filter-actions button{min-height:30px;padding:5px 9px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);font:inherit;font-size:10px;font-weight:650;cursor:pointer}
.pipeline-filter-actions button:hover{border-color:var(--accent);background:var(--soft)}
@media(max-width:760px){.pipeline-filter-actions{width:100%;margin-left:0}}

/* Dashboard without graph: executive overview */
.executive-stat .widget-content{
  display:grid;
  align-content:center;
  gap:4px;
  min-height:100%;
}
.executive-stat .widget-content>span{
  color:var(--muted);
  font-size:10px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.07em;
}
.executive-stat .widget-content>strong{
  font-size:27px;
  line-height:1.05;
  letter-spacing:-.045em;
}
.executive-stat .widget-content>small{
  color:var(--muted);
  font-size:9px;
}
.executive-list-card .widget-content{
  min-height:100%;
}
.dashboard-action-list,
.dashboard-opportunity-list{
  display:grid;
  gap:8px;
}
.dashboard-action-row,
.dashboard-opportunity-row,
.dashboard-compact-row{
  width:100%;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.dashboard-action-row:hover,
.dashboard-opportunity-row:hover,
.dashboard-compact-row:hover{
  border-color:var(--accent);
  background:var(--soft);
  transform:translateY(-1px);
}
.dashboard-action-row{
  display:grid;
  grid-template-columns:82px minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:11px 12px;
  text-align:left;
}
.dashboard-action-date{
  color:var(--muted);
  font-size:10px;
  font-weight:700;
}
.dashboard-action-copy strong,
.dashboard-action-copy small{
  display:block;
}
.dashboard-action-copy strong{
  font-size:12px;
}
.dashboard-action-copy small{
  margin-top:3px;
  color:var(--muted);
  font-size:9px;
}
.dashboard-action-arrow{
  color:var(--muted);
  font-size:19px;
}
.dashboard-opportunity-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:12px;
  align-items:center;
  padding:12px;
  text-align:left;
}
.dashboard-opportunity-main strong,
.dashboard-opportunity-main small{
  display:block;
}
.dashboard-opportunity-main strong{
  font-size:12px;
}
.dashboard-opportunity-main small{
  margin-top:3px;
  color:var(--muted);
  font-size:9px;
}
.dashboard-opportunity-value{
  font-size:12px;
  white-space:nowrap;
}
.dashboard-compact-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:9px 10px;
  margin-bottom:6px;
  text-align:left;
}
.dashboard-compact-row span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-compact-row b{
  white-space:nowrap;
}
@media(max-width:700px){
  .dashboard-action-row{
    grid-template-columns:1fr auto;
  }
  .dashboard-action-date{
    grid-column:1/-1;
  }
  .dashboard-opportunity-row{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .dashboard-opportunity-value{
    grid-column:1/-1;
  }
}

/* Nivo4 V4 Dashboard rebuild */
#dashboard{
  min-width:0;
}
.dashboard-toolbar,
#dashboardGrid,
.dashboard-widget,
.widget-handle,
.widget-resize-handle{
  display:none!important;
}
.dashboard-hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
}
.dashboard-hero h2{
  margin:5px 0 7px;
  font-size:31px;
  letter-spacing:-.04em;
}
.dashboard-hero p{
  margin:0;
  color:var(--muted);
}
.dashboard-kpi-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.dashboard-kpi-card{
  display:grid;
  gap:5px;
  min-height:126px;
  padding:20px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--panel);
  box-shadow:0 10px 26px rgba(15,23,42,.05);
}
.dashboard-kpi-card.primary{
  background:color-mix(in srgb,var(--user-app-color,#0f2f49) 9%,var(--panel));
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 34%,var(--line));
}
.dashboard-kpi-card>span{
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.dashboard-kpi-card>strong{
  margin-top:4px;
  font-size:29px;
  line-height:1;
  letter-spacing:-.05em;
}
.dashboard-kpi-card>small{
  margin-top:auto;
  color:var(--muted);
  font-size:9px;
}
.dashboard-main-grid{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  gap:16px;
}
.dashboard-secondary-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:16px;
}
.dashboard-panel{
  min-width:0;
}
.dashboard-action-list,
.dashboard-opportunity-list,
.dashboard-product-list{
  display:grid;
  gap:8px;
}
.dashboard-summary-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.dashboard-summary-grid>div{
  display:grid;
  gap:4px;
  min-height:82px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--soft);
}
.dashboard-summary-grid span{
  color:var(--muted);
  font-size:9px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.dashboard-summary-grid strong{
  font-size:20px;
}
.dashboard-product-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--panel);
}
.dashboard-product-row span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-product-row strong{
  min-width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:var(--soft);
}
.dashboard-action-row,
.dashboard-opportunity-row{
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.dashboard-action-row:hover,
.dashboard-opportunity-row:hover{
  border-color:var(--accent);
  background:var(--soft);
  transform:translateY(-1px);
}
.dashboard-action-row{
  display:grid;
  grid-template-columns:82px minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:12px;
  text-align:left;
}
.dashboard-action-date{
  color:var(--muted);
  font-size:10px;
  font-weight:700;
}
.dashboard-action-copy strong,
.dashboard-action-copy small{
  display:block;
}
.dashboard-action-copy small{
  margin-top:3px;
  color:var(--muted);
  font-size:9px;
}
.dashboard-action-arrow{
  color:var(--muted);
  font-size:20px;
}
.dashboard-opportunity-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:12px;
  align-items:center;
  padding:12px;
  text-align:left;
}
.dashboard-opportunity-main strong,
.dashboard-opportunity-main small{
  display:block;
}
.dashboard-opportunity-main small{
  margin-top:3px;
  color:var(--muted);
  font-size:9px;
}
.dashboard-opportunity-value{
  white-space:nowrap;
}
@media(max-width:1000px){
  .dashboard-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .dashboard-main-grid,
  .dashboard-secondary-grid{
    grid-template-columns:1fr;
  }
}
@media(max-width:640px){
  .dashboard-hero{
    align-items:flex-start;
    flex-direction:column;
  }
  .dashboard-hero .btn{
    width:100%;
  }
  .dashboard-kpi-grid{
    grid-template-columns:1fr;
  }
  .dashboard-action-row{
    grid-template-columns:1fr auto;
  }
  .dashboard-action-date{
    grid-column:1/-1;
  }
  .dashboard-opportunity-row{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .dashboard-opportunity-value{
    grid-column:1/-1;
  }
}

/* Calculator rebuild without artwork dimensions */
#calculator .calc-grid .grid.three{
  align-items:start;
}
#calculator .calc-grid .grid.three>label{
  min-width:0;
}
@media(min-width:1100px){
  #calculator .calc-grid>article:first-child .grid.three{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

/* Calculator button and input interaction repair */
#calculator button,
#calculator input,
#calculator select,
#calculator textarea{
  position:relative;
  z-index:1;
  pointer-events:auto;
}
#calculateBtn:active,
#saveQuote:active,
#resetCalc:active,
#copyQuote:active,
#printQuote:active{
  transform:translateY(1px);
}

/* Apply and update Pipeline feedback */
#applyPortalNegotiation[disabled]{
  cursor:wait;
  opacity:.72;
}
#portalNegotiationStatus{
  min-height:18px;
  line-height:1.4;
}

/* Official quote email request */
.portal-email-request-hint{
  display:block;
  margin:-4px 2px 4px;
  color:#7b8494;
  font-size:9px;
  line-height:1.4;
}
#portalRequestQuote[disabled]{
  opacity:.65;
  cursor:not-allowed;
}

/* Unified prospect price negotiation */
.unified-negotiation-toggle{
  max-width:420px;
}
.portal-maker-badge{
  background:color-mix(in srgb,var(--user-app-color,#0f2f49) 86%,#ffffff)!important;
}
.portal-negotiation-panel:not(.hidden)::before{
  content:"Price negotiation"!important;
}

/* Smooth Order Now confirmation */
.order-thank-you-modal{
  z-index:2147483600!important;
}
.order-thank-you-card{
  width:min(480px,100%);
  padding:34px;
  text-align:center;
  border-radius:24px;
}
.order-success-icon{
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  margin:0 auto 17px;
  border-radius:50%;
  background:#ecfdf3;
  border:1px solid #bbf7d0;
  color:#15803d;
  font-size:30px;
  font-weight:800;
  box-shadow:0 12px 28px rgba(21,128,61,.13);
}
.order-thank-you-card h2{
  margin:7px 0 10px;
  font-size:27px;
  letter-spacing:-.04em;
}
.order-thank-you-card p{
  margin:7px auto;
  max-width:390px;
  color:var(--muted);
  line-height:1.6;
}
.order-confirmation-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:22px 0;
  text-align:left;
}
.order-confirmation-summary>div{
  display:grid;
  gap:5px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--soft);
}
.order-confirmation-summary span{
  color:var(--muted);
  font-size:9px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.order-confirmation-summary strong{
  font-size:14px;
}
.order-thank-you-card>.btn{
  width:100%;
}
.portal-action-button[disabled]{
  cursor:wait;
  opacity:.72;
}
@media(max-width:520px){
  .order-thank-you-card{
    padding:26px 18px;
  }
  .order-confirmation-summary{
    grid-template-columns:1fr;
  }
}

/* Cleaned Pipeline workspace */
#pipeline .forecast-hero{
  margin-bottom:18px;
}
#pipeline .forecast-summary-grid{
  margin-bottom:18px;
}
#pipeline .forecast-top-layout{
  margin-top:0!important;
  margin-bottom:18px;
}
#pipeline .forecast-table-card{
  margin-top:0!important;
}
#pipeline .forecast-toolbar{
  align-items:flex-end;
}
#pipeline .forecast-toolbar-controls{
  flex-wrap:wrap;
}
#pipeline .forecast-list{
  min-height:320px;
}
#pipeline .forecast-row{
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
#pipeline .forecast-row:hover{
  transform:translateY(-1px);
}
@media(max-width:980px){
  #pipeline .forecast-top-layout{
    grid-template-columns:1fr!important;
  }
}

/* Pipeline top panels — equal-height rebuild */
#pipeline .pipeline-equal-panels{
  --pipeline-panel-height: 540px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  align-items:stretch;
  margin-top:18px;
  margin-bottom:18px;
}

#pipeline .pipeline-overview-card{
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  height:var(--pipeline-panel-height);
  min-height:var(--pipeline-panel-height);
  max-height:var(--pipeline-panel-height);
  padding:24px;
  overflow:hidden;
}

#pipeline .pipeline-card-head{
  min-height:126px;
  margin:0;
  padding:0 0 18px;
  align-items:flex-start;
  border-bottom:1px solid var(--line);
}

#pipeline .pipeline-card-head>div{
  min-width:0;
}

#pipeline .pipeline-card-head h2{
  margin:4px 0 7px;
  line-height:1.12;
}

#pipeline .pipeline-card-head p{
  max-width:310px;
  margin:0;
  color:var(--muted);
  line-height:1.55;
}

#pipeline .pipeline-card-head .chart-type-control{
  flex:0 0 auto;
  min-width:132px;
}

#pipeline .pipeline-panel-content{
  min-width:0;
  min-height:0;
  padding-top:18px;
}

#pipeline .pipeline-chart-content{
  display:grid;
  align-items:center;
  overflow:hidden;
}

#pipeline .pipeline-chart-content>.stage-chart,
#pipeline .pipeline-chart-content>.forecast-bar-graph{
  width:100%;
  min-height:0;
  max-height:100%;
  margin:0;
}

#pipeline .pipeline-actions-content{
  overflow:hidden;
}

#pipeline .pipeline-actions-content .upcoming-actions{
  height:100%;
  max-height:100%;
  padding-right:5px;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  align-content:start;
}

#pipeline .pipeline-actions-content .upcoming-actions::-webkit-scrollbar{
  width:7px;
}

#pipeline .pipeline-actions-content .upcoming-actions::-webkit-scrollbar-thumb{
  border-radius:999px;
  background:color-mix(in srgb,var(--muted) 32%,transparent);
}

#pipeline .upcoming-action{
  min-height:82px;
  flex:none;
}

#pipeline .forecast-table-card{
  margin-top:0!important;
}

/* Avoid older rules forcing mismatched card heights. */
#pipeline .forecast-graphs-grid,
#pipeline .forecast-graphs-grid .forecast-chart-card{
  min-height:0;
  height:auto;
}

/* Medium desktop: keep equal height, use two columns with actions full width. */
@media(max-width:1280px) and (min-width:901px){
  #pipeline .pipeline-equal-panels{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  #pipeline .pipeline-overview-card{
    --pipeline-panel-height:500px;
  }

  #pipeline .forecast-actions-card{
    grid-column:1/-1;
    height:420px;
    min-height:420px;
    max-height:420px;
  }
}

/* Tablet and mobile: panels stack and can grow naturally. */
@media(max-width:900px){
  #pipeline .pipeline-equal-panels{
    grid-template-columns:1fr;
  }

  #pipeline .pipeline-overview-card{
    height:auto;
    min-height:420px;
    max-height:none;
  }

  #pipeline .forecast-actions-card{
    min-height:440px;
  }

  #pipeline .pipeline-actions-content .upcoming-actions{
    max-height:330px;
  }
}

@media(max-width:600px){
  #pipeline .pipeline-overview-card{
    min-height:390px;
    padding:18px;
  }

  #pipeline .pipeline-card-head{
    min-height:0;
    flex-direction:column;
    gap:12px;
  }

  #pipeline .pipeline-card-head .chart-type-control{
    width:100%;
  }

  #pipeline .pipeline-card-head .chart-type-control select{
    width:100%;
  }

  #pipeline .upcoming-action{
    grid-template-columns:1fr auto;
  }

  #pipeline .upcoming-date{
    grid-column:1/-1;
  }
}

/* Single page-header rebuild */
#dashboard .dashboard-hero,
#pipeline .forecast-hero,
#externalQuotes .external-quotes-hero{
  display:none!important;
}

.page-content-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  min-height:42px;
  margin:0 0 18px;
}

.page-content-actions .btn{
  min-height:40px;
  padding-inline:16px;
}

/* The global topbar is the only page title area. */
.topbar{
  min-height:82px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}

.topbar h1{
  margin:0;
  font-size:28px;
  line-height:1.05;
  letter-spacing:-.035em;
}

.topbar p{
  margin:6px 0 0;
  max-width:720px;
  color:var(--muted);
  line-height:1.45;
}

/* Consistent content rhythm across the rebuilt tabs. */
#dashboard,
#pipeline,
#externalQuotes{
  padding-top:22px;
}

#dashboard .dashboard-kpi-grid,
#pipeline .forecast-summary-grid,
#externalQuotes .external-kpi-grid{
  margin-top:0!important;
}

#dashboard .section-gap,
#pipeline .section-gap,
#externalQuotes .section-gap{
  margin-top:18px;
}

#dashboard .card,
#pipeline .card,
#externalQuotes .card{
  border-radius:18px;
}

#dashboard .card-head,
#pipeline .card-head,
#externalQuotes .card-head{
  gap:18px;
}

#dashboard .card-head h2,
#pipeline .card-head h2,
#externalQuotes .card-head h2{
  margin-top:3px;
  letter-spacing:-.025em;
}

#externalQuotes .external-list-head{
  align-items:flex-end;
}

#externalQuotes .external-search{
  min-width:280px;
}

#pipeline .pipeline-equal-panels{
  margin-top:18px!important;
}

#pipeline .forecast-summary-grid{
  margin-bottom:0!important;
}

#dashboard .dashboard-kpi-grid{
  margin-bottom:0;
}

@media(max-width:760px){
  .page-content-actions{
    justify-content:stretch;
    margin-bottom:14px;
  }

  .page-content-actions .btn{
    width:100%;
  }

  .topbar{
    align-items:flex-start;
  }

  #externalQuotes .external-list-head{
    align-items:stretch;
    flex-direction:column;
  }

  #externalQuotes .external-search{
    min-width:0;
    width:100%;
  }
}


/* V5 consolidated contact-email validation */
#cContactEmail:invalid:not(:placeholder-shown){
  border-color:#dc2626;
}
#cContactEmail:valid:not(:placeholder-shown){
  border-color:color-mix(in srgb,#16a34a 55%,var(--line));
}

/* V5 Pipeline Actions menu — touch and foreground fix */
#pipeline .forecast-table-card,
#pipeline .forecast-list,
#pipeline .forecast-row,
#pipeline .forecast-actions,
#pipeline .forecast-action-menu{
  overflow:visible!important;
}

.forecast-action-trigger{
  position:relative;
  z-index:2;
  min-height:38px;
  min-width:104px;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

.forecast-action-trigger[aria-expanded="true"]{
  border-color:var(--accent);
  background:var(--soft);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--user-app-color,#0f2f49) 10%,transparent);
}

.forecast-action-dropdown{
  display:none;
  min-width:180px!important;
  padding:6px!important;
  border:1px solid var(--line)!important;
  border-radius:13px!important;
  background:var(--panel)!important;
  box-shadow:0 24px 70px rgba(15,23,42,.28)!important;
  isolation:isolate;
}

.forecast-action-dropdown.open{
  display:grid!important;
  gap:2px;
  animation:forecastActionsOpen .12s ease-out;
}

.forecast-action-dropdown[data-floating="true"]{
  position:fixed!important;
  z-index:2147483646!important;
}

.forecast-action-dropdown button{
  width:100%;
  min-height:40px;
  display:flex;
  align-items:center;
  padding:9px 11px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--text);
  font:inherit;
  font-size:11px;
  text-align:left;
  cursor:pointer;
  touch-action:manipulation;
}

.forecast-action-dropdown button:hover,
.forecast-action-dropdown button:focus-visible{
  background:var(--soft);
  outline:none;
}

.forecast-action-dropdown button.danger{
  color:#dc2626;
}

.forecast-action-dropdown button.danger:hover,
.forecast-action-dropdown button.danger:focus-visible{
  background:#fef2f2;
}

@keyframes forecastActionsOpen{
  from{
    opacity:0;
    transform:translateY(-4px) scale(.98);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@media(max-width:760px){
  .forecast-action-trigger{
    min-width:96px;
  }

  .forecast-action-dropdown{
    min-width:190px!important;
  }
}

/* V5 stable global Pipeline Actions menu */
.pipeline-global-actions-menu{
  position:fixed;
  left:-9999px;
  top:-9999px;
  z-index:2147483646;
  display:none;
  min-width:184px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--panel);
  box-shadow:0 24px 70px rgba(15,23,42,.30);
}

.pipeline-global-actions-menu.open{
  display:grid;
  gap:2px;
  animation:pipelineGlobalMenuOpen .1s ease-out;
}

.pipeline-global-actions-menu button{
  width:100%;
  min-height:41px;
  display:flex;
  align-items:center;
  padding:9px 11px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--text);
  font:inherit;
  font-size:11px;
  text-align:left;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

.pipeline-global-actions-menu button:hover,
.pipeline-global-actions-menu button:focus-visible{
  background:var(--soft);
  outline:none;
}

.pipeline-global-actions-menu button.danger{
  color:#dc2626;
}

.pipeline-global-actions-menu button.danger:hover,
.pipeline-global-actions-menu button.danger:focus-visible{
  background:#fef2f2;
}

.forecast-action-trigger{
  min-width:104px;
  min-height:38px;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

.forecast-action-trigger[aria-expanded="true"]{
  border-color:var(--accent);
  background:var(--soft);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--user-app-color,#0f2f49) 10%,transparent);
}

@keyframes pipelineGlobalMenuOpen{
  from{
    opacity:0;
    transform:translateY(-3px) scale(.985);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

/* Disable old row-contained dropdowns completely. */
.forecast-action-dropdown{
  display:none!important;
}

/* Reliable Settings save feedback */
#saveSettings[disabled]{
  cursor:wait;
  opacity:.72;
}
#settingsSaveMessage{
  transition:color .15s ease;
}

/* Rebuilt Settings persistence feedback */
#settingsSaveMessage{display:block;min-height:16px}
#saveSettings[disabled]{cursor:wait;opacity:.7}

/* Protected recalculation confirmation */
.recalculate-confirmation-modal{
  z-index:2147483600!important;
}
.recalculate-confirmation-card{
  width:min(520px,100%);
  padding:32px;
  border-radius:22px;
}
.recalculate-warning-icon{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  margin-bottom:16px;
  border-radius:50%;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#c2410c;
  font-size:28px;
  font-weight:850;
}
.recalculate-confirmation-card h2{
  margin:6px 0 10px;
  font-size:26px;
  letter-spacing:-.04em;
}
.recalculate-confirmation-card>p{
  margin:0;
  color:var(--muted);
  line-height:1.6;
}
.recalculate-price-comparison{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:22px 0;
}
.recalculate-price-comparison>div{
  display:grid;
  gap:5px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--soft);
}
.recalculate-price-comparison span{
  color:var(--muted);
  font-size:9px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.recalculate-price-comparison strong{
  font-size:14px;
}
.recalculate-confirmation-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
@media(max-width:560px){
  .recalculate-confirmation-card{
    padding:24px 18px;
  }
  .recalculate-price-comparison{
    grid-template-columns:1fr;
  }
  .recalculate-confirmation-actions{
    flex-direction:column-reverse;
  }
  .recalculate-confirmation-actions .btn{
    width:100%;
  }
}

/* Current calculated price selection */
.recalculate-price-comparison{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
@media(max-width:700px){
  .recalculate-price-comparison{
    grid-template-columns:1fr;
  }
}

/* Total Recalculated Price source-of-truth */
#cRrp{
  font-weight:700;
}
#cRrp:focus{
  box-shadow:0 0 0 3px color-mix(in srgb,var(--user-app-color,#0f2f49) 12%,transparent);
}

/* Machine edit units and monetary maintenance */
.machine-edit-grid{
  align-items:start;
}
.machine-field{
  display:grid;
  gap:7px;
}
.machine-label-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.machine-label-line>span{
  min-width:0;
}
.unit-badge{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:22px;
  padding:3px 7px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--soft);
  color:var(--muted);
  font-size:9px;
  font-weight:750;
  line-height:1;
  letter-spacing:.02em;
  text-transform:none;
}
.machine-field input{
  width:100%;
}

/* Machine edit save reliability */
.machine-edit-grid input{
  font-variant-numeric:tabular-nums;
}
#modalSave[disabled],
#saveModal[disabled]{
  cursor:wait;
  opacity:.72;
}

/* Verified machine and currency saving */
#modalSave[disabled],
#saveSettings[disabled]{
  cursor:wait;
  opacity:.7;
}
#sCurrency{
  font-weight:700;
}

/* Compact Machines list with one-line Actions menu */
#machines .card{
  overflow:visible;
}

#machineList{
  display:grid;
  gap:8px;
  overflow:visible;
}

.machine-list-row{
  display:grid;
  grid-template-columns:28px minmax(150px,1.45fr) repeat(5,minmax(92px,.85fr)) 112px;
  gap:12px;
  align-items:center;
  min-height:66px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--panel);
  transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease;
  overflow:visible;
}

.machine-list-row:hover{
  transform:translateY(-1px);
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 24%,var(--line));
  box-shadow:0 10px 26px rgba(15,23,42,.07);
}

.machine-list-row.dragging{
  opacity:.58;
}

.machine-list-name,
.machine-list-value{
  min-width:0;
}

.machine-list-name{
  display:grid;
  gap:3px;
}

.machine-list-name strong,
.machine-list-name small,
.machine-list-value strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.machine-list-name strong{
  font-size:12px;
}

.machine-list-name small,
.machine-list-value span{
  color:var(--muted);
  font-size:9px;
}

.machine-list-value{
  display:grid;
  gap:4px;
}

.machine-list-value span{
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:700;
}

.machine-list-value strong{
  font-size:11px;
  font-variant-numeric:tabular-nums;
}

.machine-list-actions{
  display:flex;
  justify-content:flex-end;
}

.machine-action-trigger{
  min-width:100px;
}

.machine-global-actions-menu{
  min-width:184px;
}

@media(max-width:1180px){
  .machine-list-row{
    grid-template-columns:28px minmax(140px,1.4fr) repeat(3,minmax(90px,.8fr)) 108px;
  }

  .machine-list-row .machine-list-value:nth-of-type(5),
  .machine-list-row .machine-list-value:nth-of-type(6){
    display:none;
  }
}

@media(max-width:820px){
  .machine-list-row{
    grid-template-columns:26px minmax(130px,1.4fr) minmax(90px,.8fr) minmax(90px,.8fr) 104px;
  }

  .machine-list-row .machine-list-value:nth-of-type(n+4){
    display:none;
  }
}

@media(max-width:560px){
  .machine-list-row{
    grid-template-columns:24px minmax(0,1fr) 98px;
    gap:9px;
  }

  .machine-list-row .machine-list-value{
    display:none!important;
  }

  .machine-action-trigger{
    min-width:92px;
  }
}

/* Compact Product Library list */
#products .card{
  overflow:visible;
}

#productList{
  display:grid;
  gap:8px;
  overflow:visible;
}

.product-list-row{
  display:grid;
  grid-template-columns:28px minmax(150px,1.45fr) repeat(6,minmax(90px,.82fr)) 112px;
  gap:12px;
  align-items:center;
  min-height:66px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--panel);
  transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease;
  overflow:visible;
}

.product-list-row:hover{
  transform:translateY(-1px);
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 24%,var(--line));
  box-shadow:0 10px 26px rgba(15,23,42,.07);
}

.product-list-row.dragging{
  opacity:.58;
}

.product-list-name,
.product-list-value{
  min-width:0;
}

.product-list-name{
  display:grid;
  gap:3px;
}

.product-list-name strong,
.product-list-name small,
.product-list-value strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.product-list-name strong{
  font-size:12px;
}

.product-list-name small,
.product-list-value span{
  color:var(--muted);
  font-size:9px;
}

.product-list-value{
  display:grid;
  gap:4px;
}

.product-list-value span{
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:700;
}

.product-list-value strong{
  font-size:11px;
  font-variant-numeric:tabular-nums;
}

.product-list-actions{
  display:flex;
  justify-content:flex-end;
}

.product-action-trigger{
  min-width:100px;
}

.product-global-actions-menu{
  min-width:184px;
}

/* Product detail units */
.product-edit-grid{
  align-items:start;
}

.product-field{
  display:grid;
  gap:7px;
}

.product-machine-field{
  grid-column:1/-1;
}

.product-field input,
.product-field select{
  width:100%;
}

@media(max-width:1260px){
  .product-list-row{
    grid-template-columns:28px minmax(140px,1.45fr) repeat(4,minmax(88px,.8fr)) 108px;
  }

  .product-list-row .product-list-value:nth-of-type(6),
  .product-list-row .product-list-value:nth-of-type(7){
    display:none;
  }
}

@media(max-width:900px){
  .product-list-row{
    grid-template-columns:26px minmax(130px,1.4fr) repeat(3,minmax(86px,.8fr)) 104px;
  }

  .product-list-row .product-list-value:nth-of-type(n+5){
    display:none;
  }
}

@media(max-width:620px){
  .product-list-row{
    grid-template-columns:24px minmax(0,1fr) 98px;
    gap:9px;
  }

  .product-list-row .product-list-value{
    display:none!important;
  }

  .product-action-trigger{
    min-width:92px;
  }

  .product-machine-field{
    grid-column:auto;
  }
}

/* Product Library drag-and-drop repair */
.product-list-row{
  position:relative;
}

.product-list-row.dragging{
  opacity:.48;
  transform:scale(.995);
}

.product-list-row.drag-over-before::before,
.product-list-row.drag-over-after::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  height:3px;
  border-radius:999px;
  background:var(--accent);
  pointer-events:none;
  z-index:4;
}

.product-list-row.drag-over-before::before{
  top:-6px;
}

.product-list-row.drag-over-after::after{
  bottom:-6px;
}

.product-list-row .drag-handle{
  cursor:grab;
  user-select:none;
  touch-action:none;
}

.product-list-row.dragging .drag-handle{
  cursor:grabbing;
}

.product-action-trigger{
  touch-action:manipulation;
}

/* Machines drag-and-drop repair */
.machine-list-row{
  position:relative;
}

.machine-list-row.drag-armed{
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 32%,var(--line));
}

.machine-list-row.dragging{
  opacity:.46;
  transform:none!important;
  box-shadow:none;
}

.machine-list-row.drag-over-before::before,
.machine-list-row.drag-over-after::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  height:3px;
  border-radius:999px;
  background:var(--accent);
  pointer-events:none;
  z-index:5;
}

.machine-list-row.drag-over-before::before{
  top:-6px;
}

.machine-list-row.drag-over-after::after{
  bottom:-6px;
}

.machine-list-row .drag-handle{
  cursor:grab;
  user-select:none;
  touch-action:none;
  -webkit-user-drag:none;
}

.machine-list-row.dragging .drag-handle{
  cursor:grabbing;
}

.machine-list-row:has(.machine-action-trigger[aria-expanded="true"]){
  z-index:2;
}

.machine-action-trigger{
  touch-action:manipulation;
}

/* Green Actions buttons */
.forecast-action-trigger,
.machine-action-trigger,
.product-action-trigger{
  background:#1f9d55 !important;
  border-color:#1f9d55 !important;
  color:#fff !important;
}
.forecast-action-trigger:hover,
.machine-action-trigger:hover,
.product-action-trigger:hover{
  background:#18864a !important;
  border-color:#18864a !important;
}

/* Action button dropdown indicator */
.forecast-action-trigger,
.machine-action-trigger,
.product-action-trigger{
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.forecast-action-chevron{
  color:currentColor !important;
  font-size:11px;
  font-weight:700;
  line-height:1;
}

/* Compact External Quotes list */
#externalQuotes .card,
#externalQuotes .external-quotes-list-card{
  overflow:visible;
}

#externalQuotesList{
  display:grid;
  gap:8px;
  overflow:visible;
}

.external-compact-row{
  display:grid;
  grid-template-columns:minmax(180px,1.45fr) minmax(150px,1.1fr) minmax(120px,.8fr) minmax(95px,.7fr) minmax(105px,.75fr) 112px;
  gap:12px;
  align-items:center;
  min-height:68px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--panel);
  cursor:pointer;
  transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease;
  overflow:visible;
}

.external-compact-row:hover{
  transform:translateY(-1px);
  border-color:color-mix(in srgb,var(--user-app-color,#0f2f49) 24%,var(--line));
  box-shadow:0 10px 26px rgba(15,23,42,.07);
}

.external-compact-main,
.external-compact-value{
  min-width:0;
}

.external-compact-main,
.external-compact-value{
  display:grid;
  gap:3px;
}

.external-compact-main strong,
.external-compact-main small,
.external-compact-value strong,
.external-compact-value small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.external-compact-main strong{
  font-size:12px;
}

.external-compact-main small,
.external-compact-value small,
.external-compact-value span{
  color:var(--muted);
  font-size:9px;
}

.external-compact-value span{
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:700;
}

.external-compact-value strong{
  font-size:11px;
  font-variant-numeric:tabular-nums;
}

.external-compact-actions{
  display:flex;
  justify-content:flex-end;
}

.external-action-trigger{
  min-width:100px;
}

.external-global-actions-menu{
  min-width:184px;
}

@media(max-width:1100px){
  .external-compact-row{
    grid-template-columns:minmax(170px,1.4fr) minmax(140px,1fr) minmax(105px,.8fr) minmax(95px,.7fr) 108px;
  }

  .external-compact-row .external-compact-value:nth-of-type(5){
    display:none;
  }
}

@media(max-width:820px){
  .external-compact-row{
    grid-template-columns:minmax(150px,1.4fr) minmax(120px,1fr) minmax(100px,.8fr) 104px;
  }

  .external-compact-row .external-compact-value:nth-of-type(4),
  .external-compact-row .external-compact-value:nth-of-type(5){
    display:none;
  }
}

@media(max-width:580px){
  .external-compact-row{
    grid-template-columns:minmax(0,1fr) 98px;
    gap:9px;
  }

  .external-compact-row .external-compact-value{
    display:none!important;
  }

  .external-action-trigger{
    min-width:92px;
  }
}

/* Complete Settings persistence */
#settingsSaveMessage{
  min-height:16px;
  display:block;
}
#saveSettings[disabled]{
  cursor:wait;
  opacity:.7;
}
.settings-action-bar{
  position:sticky;
  bottom:0;
  z-index:12;
}

/* Immediate theme switching */
body,
.app-shell,
.sidebar,
.topbar,
.card,
.settings-panel,
.modal-card{
  transition:
    background-color .18s ease,
    color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.item-image-editor{display:grid;grid-template-columns:112px minmax(0,1fr);gap:18px;align-items:center;margin-bottom:20px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--soft)}
.item-image-preview{width:112px;height:92px;display:grid;place-items:center;overflow:hidden;border:1px dashed color-mix(in srgb,var(--muted) 45%,transparent);border-radius:13px;background:var(--panel)}
.item-image-preview img,.item-list-thumbnail img{width:100%;height:100%;object-fit:cover}
.item-image-placeholder{color:var(--muted);font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.06em}
.item-image-controls{display:grid;gap:5px}.item-image-controls>small{color:var(--muted)}.item-image-controls>div{display:flex;gap:8px;margin-top:5px}.item-image-upload{cursor:pointer}
.item-list-thumbnail{width:42px;height:42px;display:grid;place-items:center;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--soft)}
.item-list-thumbnail-empty{color:var(--muted);font-size:13px;font-weight:800}
.product-list-row{grid-template-columns:28px 42px minmax(150px,1.45fr) repeat(6,minmax(90px,.82fr)) 112px}
.machine-list-row{grid-template-columns:28px 42px minmax(150px,1.45fr) repeat(5,minmax(92px,.85fr)) 112px}
@media(max-width:1260px){.product-list-row{grid-template-columns:28px 42px minmax(140px,1.45fr) repeat(4,minmax(88px,.8fr)) 108px}}
@media(max-width:1180px){.machine-list-row{grid-template-columns:28px 42px minmax(140px,1.4fr) repeat(3,minmax(90px,.8fr)) 108px}}
@media(max-width:900px){.product-list-row{grid-template-columns:26px 42px minmax(130px,1.4fr) repeat(3,minmax(86px,.8fr)) 104px}}
@media(max-width:820px){.machine-list-row{grid-template-columns:26px 42px minmax(130px,1.4fr) minmax(90px,.8fr) minmax(90px,.8fr) 104px}}
@media(max-width:620px){.product-list-row{grid-template-columns:24px 40px minmax(0,1fr) 98px}}
@media(max-width:560px){.machine-list-row{grid-template-columns:24px 40px minmax(0,1fr) 98px}}
@media(max-width:520px){.item-image-editor{grid-template-columns:1fr}.item-image-preview{width:100%;height:150px}}

/* Verified Product/Machine save state */
#modalSave[disabled]{
  cursor:wait;
  opacity:.72;
}

/* Generic External Configurator prospect details */
.portal-prospect-details{
  display:grid;
  gap:12px;
  margin:16px 0;
  padding:16px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--soft);
}
.portal-section-subhead{
  display:grid;
  gap:3px;
}
.portal-section-subhead small{
  color:var(--muted);
}
.portal-prospect-error{
  min-height:18px;
  margin:0;
  color:#b91c1c;
  font-size:11px;
  font-weight:700;
}
.portal-prospect-details input:invalid:not(:placeholder-shown){
  border-color:#dc2626;
}

/* Reliable prospect contact form */
.portal-prospect-details input{
  position:relative;
  z-index:1;
  pointer-events:auto;
}
.portal-prospect-details input:focus{
  outline:2px solid color-mix(in srgb,var(--accent) 35%,transparent);
  outline-offset:1px;
}

/* Configurator access details shown before interactive pricing */
.customer-portal-access-details{
  max-width:720px;
  margin:34px auto;
  padding:28px;
  display:grid;
  gap:18px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--panel);
  box-shadow:0 22px 60px rgba(15,23,42,.12);
}

.customer-portal-access-details.hidden{
  display:none!important;
}

.portal-access-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:color-mix(in srgb,var(--accent) 14%,transparent);
  color:var(--accent);
  font-size:24px;
  font-weight:800;
}

.customer-portal-access-details h2,
.customer-portal-access-details p{
  margin:0;
}

.customer-portal-access-details>p{
  color:var(--muted);
}

.portal-access-values{
  display:grid;
  gap:14px;
}

.portal-access-value{
  display:grid;
  gap:7px;
}

.portal-access-value>span{
  color:var(--muted);
  font-size:10px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.portal-access-copy-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:9px;
}

.portal-access-copy-row input{
  width:100%;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:11px;
  background:var(--soft);
}

.portal-access-note{
  padding:12px 14px;
  border-radius:12px;
  background:color-mix(in srgb,var(--accent) 8%,var(--soft));
  color:var(--muted);
  font-size:11px;
}

#continueToCustomerPortal{
  justify-self:start;
}

@media(max-width:620px){
  .customer-portal-access-details{
    margin:18px 12px;
    padding:20px;
  }

  .portal-access-copy-row{
    grid-template-columns:1fr;
  }

  .portal-access-copy-row .btn,
  #continueToCustomerPortal{
    width:100%;
  }
}

/* Email validation feedback */
#portalContactEmail.email-invalid{
  border-color:#dc2626!important;
}

/* Reliable Product Actions interaction */
#productGlobalActionsMenu [data-product-action]{
  width:100%;
  cursor:pointer;
  touch-action:manipulation;
  pointer-events:auto;
}
#productGlobalActionsMenu [data-product-action]:active{
  transform:translateY(1px);
}

/* Trial and subscription management */
.subscribe-now-button{
  background:#1f9d55;
  color:#fff;
  border-color:#1f9d55;
}

.subscription-profile-card{
  margin:0 0 22px;
  padding:20px;
  border:1px solid var(--line);
  border-radius:18px;
  background:
    linear-gradient(135deg,color-mix(in srgb,var(--user-app-color,#0f2f49) 8%,var(--panel)),var(--panel));
}

.subscription-profile-head{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-start;
}

.subscription-profile-head h2,
.subscription-profile-head p{
  margin:4px 0 0;
}

.subscription-profile-head p{
  color:var(--muted);
}

.subscription-status-badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.subscription-status-badge.trial{
  background:#fef3c7;
  color:#92400e;
}

.subscription-status-badge.active{
  background:#dcfce7;
  color:#166534;
}

.subscription-status-badge.expired{
  background:#fee2e2;
  color:#991b1b;
}

.subscription-summary-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:18px;
}

.subscription-summary-grid>div{
  display:grid;
  gap:5px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  min-width:0;
}

.subscription-summary-grid span{
  color:var(--muted);
  font-size:9px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.subscription-summary-grid strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}

.subscription-profile-actions{
  display:flex;
  gap:9px;
  margin-top:16px;
}

.subscription-modal .modal-card{
  position:relative;
}

.trial-reminder-card{
  width:min(520px,calc(100vw - 30px));
  text-align:center;
}

.trial-reminder-card h2{
  margin:7px 0;
}

.trial-reminder-card p{
  color:var(--muted);
}

.trial-reminder-progress{
  height:9px;
  margin:20px 0;
  overflow:hidden;
  border-radius:999px;
  background:var(--soft);
}

.trial-reminder-progress span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:#1f9d55;
  transition:width .25s ease;
}

.trial-reminder-actions{
  display:flex;
  justify-content:center;
  gap:9px;
}

.subscription-plan-card{
  width:min(820px,calc(100vw - 30px));
}

.subscription-plan-card>h2,
.subscription-plan-card>p{
  margin:6px 0;
}

.subscription-plan-card>p{
  color:var(--muted);
}

.subscription-plan-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin-top:22px;
}

.subscription-plan{
  position:relative;
  display:grid;
  align-content:start;
  gap:12px;
  padding:22px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
}

.subscription-plan.featured{
  border:2px solid #1f9d55;
  box-shadow:0 16px 40px rgba(31,157,85,.12);
}

.subscription-plan h3{
  margin:0;
  font-size:26px;
}

.subscription-plan p,
.subscription-plan li{
  color:var(--muted);
}

.subscription-plan ul{
  margin:0;
  padding-left:18px;
  display:grid;
  gap:6px;
}

.plan-label{
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.plan-ribbon{
  position:absolute;
  top:14px;
  right:14px;
  padding:5px 8px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
}

.subscription-demo-note{
  margin-top:18px!important;
  font-size:10px;
}

.subscription-confirmation-card{
  width:min(520px,calc(100vw - 30px));
  text-align:center;
}

.subscription-success-icon{
  width:60px;
  height:60px;
  margin:0 auto 12px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#dcfce7;
  color:#166534;
  font-size:28px;
  font-weight:900;
}

.subscription-confirmation-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:9px;
  margin:20px 0;
}

.subscription-confirmation-summary>div{
  display:grid;
  gap:5px;
  padding:12px;
  border-radius:12px;
  background:var(--soft);
}

.subscription-confirmation-summary span{
  color:var(--muted);
  font-size:9px;
  text-transform:uppercase;
}

@media(max-width:720px){
  .subscription-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .subscription-plan-grid{
    grid-template-columns:1fr;
  }

  .subscription-confirmation-summary{
    grid-template-columns:1fr;
  }
}

@media(max-width:480px){
  .subscription-summary-grid{
    grid-template-columns:1fr;
  }

  .subscription-profile-head,
  .trial-reminder-actions,
  .subscription-profile-actions{
    display:grid;
  }
}

/* Strict subscription plan day indicators */
.subscription-plan [data-plan-days]{
  position:relative;
}
.subscription-plan::after{
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:10px;
  font-weight:700;
}
.subscription-plan:first-child::after{
  content:"Adds 31 days";
}
.subscription-plan.featured::after{
  content:"Adds 365 days";
}

.trial-eligibility-message{padding:11px 12px;border-radius:10px;font-size:11px;line-height:1.45}
.trial-eligibility-message.hidden{display:none!important}
.trial-eligibility-message.approved{display:block;border:1px solid #86efac;background:#dcfce7;color:#166534}
.trial-eligibility-message.denied{display:block;border:1px solid #fecaca;background:#fee2e2;color:#991b1b}

/* Internal-only quotation build */
#externalQuotes,#externalQuoteModal,#externalQuotePreviewModal,#externalCustomerView,#externalGlobalActionsMenu,[data-view="externalQuotes"],#pipelineActionExternal{display:none!important}
#cProduct[multiple]{min-height:150px;padding:8px}
#cProduct[multiple] option{padding:9px 10px;border-radius:8px;margin:2px 0}
#cProduct[multiple] option:checked{font-weight:800}
.field-help{display:block;color:var(--muted);font-size:10px;font-weight:600;line-height:1.35}


/* Ten-line calculator product grid */
.calculator-lines-heading{display:grid;grid-template-columns:minmax(0,1fr) minmax(520px,1.8fr);gap:14px;align-items:end;margin-top:4px;margin-bottom:8px}.calculator-lines-heading strong,.calculator-lines-heading small{display:block}.calculator-lines-heading small{margin-top:4px;color:var(--muted);font-size:11px}.calculator-line-columns{display:grid;grid-template-columns:minmax(210px,1.25fr) minmax(180px,1fr) 110px;gap:12px;padding:0 12px;color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}.calculator-product-lines{display:grid;gap:8px}.calculator-product-line{display:grid;grid-template-columns:32px minmax(210px,1.25fr) minmax(180px,1fr) 110px;gap:12px;align-items:center;padding:9px 12px;border:1px solid var(--line);border-radius:13px;background:var(--panel)}.calculator-product-line:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(29,111,139,.08)}.calculator-line-number{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:var(--soft);color:var(--muted);font-size:11px;font-weight:900}.calculator-product-line label{display:block}.calculator-product-line select,.calculator-product-line input{min-height:40px;padding:8px 10px}.calculator-product-line select:disabled{opacity:.55}.mobile-line-label{display:none}.calculator-product-line:has(select[id^="cLineProduct"] option:checked:not([value=""])) .calculator-line-number{background:var(--user-app-color);color:#fff}@media(max-width:900px){.calculator-lines-heading{grid-template-columns:1fr}.calculator-line-columns{display:none}.calculator-product-line{grid-template-columns:32px 1fr 1fr 95px}}@media(max-width:650px){.calculator-product-line{grid-template-columns:28px 1fr;padding:10px}.calculator-product-line label{grid-column:2}.mobile-line-label{display:block;margin-bottom:5px;color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase}.calculator-line-number{grid-row:1/span 3;align-self:start}}

/* Compact table layout for the 10 calculator product lines */
.calculator-lines-heading{
  grid-template-columns:minmax(210px,1.25fr) minmax(180px,1fr) 82px;
  gap:8px;
  align-items:end;
  margin:0 0 5px;
  padding:0 8px 0 38px;
}
.calculator-lines-heading>div:first-child{
  grid-column:1/-1;
  margin-bottom:4px;
}
.calculator-lines-heading>div:first-child small{margin-top:2px}
.calculator-line-columns{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:minmax(210px,1.25fr) minmax(180px,1fr) 82px;
  gap:8px;
  padding:0;
}
.calculator-product-lines{
  display:grid;
  gap:0;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  background:var(--panel);
}
.calculator-product-line{
  grid-template-columns:28px minmax(210px,1.25fr) minmax(180px,1fr) 82px;
  gap:8px;
  min-height:43px;
  padding:4px 8px;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  background:var(--panel);
}
.calculator-product-line:last-child{border-bottom:0}
.calculator-product-line:nth-child(even){background:color-mix(in srgb,var(--soft) 35%,var(--panel))}
.calculator-product-line:focus-within{
  position:relative;
  z-index:1;
  border-color:transparent;
  box-shadow:inset 3px 0 0 var(--accent);
  background:var(--panel);
}
.calculator-line-number{
  width:22px;
  height:22px;
  border-radius:6px;
  font-size:10px;
}
.calculator-product-line select,
.calculator-product-line input{
  min-height:32px;
  height:32px;
  padding:4px 8px;
  border-radius:8px;
  font-size:12px;
}
.calculator-product-line input[type="number"]{text-align:right}
@media(max-width:900px){
  .calculator-lines-heading{display:none}
  .calculator-product-line{grid-template-columns:25px minmax(170px,1.2fr) minmax(145px,1fr) 76px}
}
@media(max-width:650px){
  .calculator-product-lines{gap:6px;border:0;background:transparent;overflow:visible}
  .calculator-product-line{
    grid-template-columns:24px 1fr;
    gap:5px 8px;
    padding:7px 8px;
    border:1px solid var(--line);
    border-radius:10px;
  }
  .calculator-product-line:last-child{border-bottom:1px solid var(--line)}
  .calculator-product-line label{grid-column:2}
  .calculator-product-line select,.calculator-product-line input{height:34px;min-height:34px}
  .mobile-line-label{margin-bottom:2px;font-size:9px}
  .calculator-line-number{grid-row:1/span 3}
}

/* Currency-aware calculator inputs */
.currency-field{font-variant-numeric:tabular-nums;text-align:right;font-weight:700}
.currency-field[readonly]{background:var(--soft)!important;color:var(--text)!important}

/* VAT and cost inclusion controls */
.cost-toggle-field>span,.checkbox-control{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:750}
.cost-toggle-field input[type="checkbox"],.checkbox-control input[type="checkbox"]{width:15px!important;height:15px!important;min-height:0!important;padding:0!important;flex:0 0 auto;accent-color:var(--user-app-color)}
.cost-toggle-field:has(input[type="checkbox"]:not(:checked))>input{opacity:.48;text-decoration:line-through}
.vat-price-mode{align-content:start}
.checkbox-control{min-height:46px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text)}

/* Production cost master control */
.production-cost-summary{display:flex;align-items:center;justify-content:space-between;gap:16px}
.select-all-costs{display:inline-flex;grid-template-columns:auto auto;align-items:center;gap:7px;font-size:11px;font-weight:800;color:var(--muted);cursor:pointer;white-space:nowrap}
.select-all-costs input{width:15px!important;height:15px!important;min-height:0!important;padding:0!important;margin:0;accent-color:var(--user-app-color,var(--accent))}
@media(max-width:600px){.production-cost-summary{align-items:flex-start}.select-all-costs{margin-top:1px}}


/* Inline VAT inclusion control in Pricing Strategy */
.vat-rate-label{align-content:start}
.vat-rate-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:24px}
.vat-inline-toggle{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:800;color:var(--muted);white-space:nowrap;cursor:pointer;text-transform:none}
.vat-inline-toggle input[type="checkbox"]{width:15px!important;height:15px!important;min-height:15px!important;margin:0;padding:0!important;accent-color:var(--user-app-color,var(--accent));cursor:pointer}
.vat-inline-toggle:has(input:checked){color:var(--text)}
@media(max-width:760px){.vat-rate-heading{align-items:flex-start;flex-direction:column;gap:5px}}

/* Dynamic calculator product lines */
.calculator-lines-heading{
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
}
.calculator-lines-heading>div:first-child{grid-column:auto!important;margin-bottom:0!important}
.calculator-lines-heading .calculator-line-columns{
  grid-column:1/-1!important;
  grid-template-columns:minmax(210px,1.25fr) minmax(180px,1fr) 82px 34px!important;
}
.calculator-product-line{
  grid-template-columns:28px minmax(210px,1.25fr) minmax(180px,1fr) 82px 34px!important;
}
.calculator-line-delete{
  width:30px;height:30px;min-height:30px;padding:0;border:0;border-radius:8px;
  display:grid;place-items:center;background:transparent;color:var(--muted);
  font-size:20px;line-height:1;cursor:pointer;
}
.calculator-line-delete:hover{background:#fee2e2;color:#b42318}
@media(max-width:900px){
  .calculator-lines-heading{display:grid!important;grid-template-columns:1fr auto!important}
  .calculator-lines-heading .calculator-line-columns{display:none!important}
  .calculator-product-line{grid-template-columns:25px minmax(170px,1.2fr) minmax(145px,1fr) 76px 34px!important}
}
@media(max-width:650px){
  .calculator-lines-heading{grid-template-columns:1fr!important}
  .calculator-lines-heading .btn{justify-self:start}
  .calculator-product-line{grid-template-columns:24px 1fr 34px!important}
  .calculator-product-line label{grid-column:2!important}
  .calculator-line-delete{grid-column:3;grid-row:1;align-self:start}
  .calculator-line-number{grid-row:1/span 3!important}
}

/* Pipeline column alignment */
:root{--pipeline-columns:minmax(250px,1.45fr) 110px 135px minmax(170px,1fr) 125px 112px}
.forecast-table-head,
.forecast-row{
  grid-template-columns:var(--pipeline-columns)!important;
  column-gap:14px!important;
}
.forecast-table-head{
  padding-left:14px!important;
  padding-right:14px!important;
  align-items:end;
}
.forecast-table-head>span:nth-child(5),
.forecast-row>div:nth-child(5){text-align:right}
.forecast-table-head>span:last-child,
.forecast-actions{justify-self:end;width:112px}
.forecast-actions .forecast-action-trigger{width:112px;justify-content:center}
@media(max-width:1100px){
  .forecast-row{grid-template-columns:1fr 1fr 1fr!important}
  .forecast-table-head{display:none!important}
  .forecast-actions{width:auto;justify-self:start}
}
@media(max-width:760px){.forecast-row{grid-template-columns:1fr!important}}

/* Compact Pipeline toolbar and Actions control */
#pipeline .forecast-toolbar-controls .forecast-search,
#pipeline .forecast-toolbar-controls .forecast-sort{
  display:grid;
  align-content:end;
  margin:0;
}
#pipeline .forecast-toolbar-controls .forecast-search input,
#pipeline .forecast-toolbar-controls .forecast-sort select{
  height:44px!important;
  min-height:44px!important;
  padding-top:9px!important;
  padding-bottom:9px!important;
}
:root{--pipeline-columns:minmax(250px,1.45fr) 110px 135px minmax(170px,1fr) 140px 88px}
#pipeline .forecast-table-head>span:last-child,
#pipeline .forecast-actions{
  justify-self:end;
  width:88px;
}
#pipeline .forecast-actions .forecast-action-trigger{
  width:88px;
  min-width:88px;
  min-height:34px;
  padding:7px 10px;
  gap:5px;
  justify-content:center;
  white-space:nowrap;
}
#pipeline .forecast-action-trigger .forecast-action-chevron{
  color:currentColor!important;
  font-size:12px;
}
@media(max-width:1100px){
  #pipeline .forecast-actions{width:auto;justify-self:start}
  #pipeline .forecast-actions .forecast-action-trigger{width:auto;min-width:82px}
}

/* Calculator field alignment rebuild */
#calculator .calculator-primary-details,
#calculator .calculator-reference-details,
#calculator .opportunity-forecast-grid{
  align-items:end;
}
#calculator .calculator-primary-details > label,
#calculator .calculator-reference-details > label,
#calculator .opportunity-forecast-grid > label{
  display:grid;
  grid-template-rows:auto 46px;
  align-self:stretch;
}
#calculator .calculator-primary-details input,
#calculator .calculator-reference-details input,
#calculator .calculator-reference-details .input-with-action,
#calculator .opportunity-forecast-grid input,
#calculator .opportunity-forecast-grid select{
  height:46px;
  min-height:46px;
  margin:0;
}
#calculator .calculator-reference-details .input-with-action{
  grid-template-columns:minmax(0,1fr) auto;
  align-items:stretch;
}
#calculator .calculator-reference-details .input-with-action .btn{
  height:46px;
  min-height:46px;
  margin:0;
}
#calculator .opportunity-forecast-grid .status-field,
#calculator .opportunity-forecast-grid .status-field select{
  width:100%;
}
@media(max-width:760px){
  #calculator .calculator-primary-details > label,
  #calculator .calculator-reference-details > label,
  #calculator .opportunity-forecast-grid > label{
    grid-template-rows:auto 46px;
  }
}

/* Volume discount checkbox in Pricing Strategy */
.pricing-checkbox-field{display:grid;gap:6px;align-content:start}
.pricing-checkbox-control{min-height:46px;display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#f1f3f5;color:var(--text);font-size:12px;font-weight:750}
.pricing-checkbox-control input[type="checkbox"]{width:16px!important;height:16px!important;min-height:16px!important;margin:0;padding:0!important;accent-color:var(--user-app-color,var(--accent));flex:0 0 auto}
[data-theme=dark] .pricing-checkbox-control{background:var(--soft)}
