/* Static preview chrome only. Real dashboard/ledger/mobile2 route CSS is copied unchanged. */
.preview-top{position:relative;z-index:200;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;padding:10px 16px;background:#251b32;color:#fff;font:13px/1.4 Inter,system-ui,sans-serif}
.preview-brand{display:flex;align-items:center;gap:9px;min-width:0}
.preview-brand strong{display:block;font-size:13px;letter-spacing:.01em}
.preview-brand small{display:block;color:#c7b7dc;font-size:10px}
.preview-mark{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border-radius:10px;background:#8543d5;color:#fff;font-size:19px;font-weight:800}
.preview-top nav{display:flex;align-items:center;gap:5px}
.preview-top nav a{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:0 12px;text-decoration:none;border:1px solid #745c92;border-radius:10px;color:#eee1ff;font-weight:650}
.preview-top nav a[aria-current="page"]{background:#8d4ce2;border-color:#a87ee5;color:#fff}
.preview-theme{display:grid;place-items:center;min-height:42px;width:42px;border:1px solid #745c92;border-radius:10px;background:#443356;color:#fff;font-size:19px;cursor:pointer}
.preview-warning{position:relative;z-index:5;padding:9px 16px;background:#fff4d1;color:#5e4312;border-bottom:1px solid #e8d398;font:600 12px/1.5 Inter,system-ui,sans-serif}
.preview-foot{padding:22px 16px 40px;text-align:center;color:var(--muted,#736b7b);font:12px/1.5 Inter,system-ui,sans-serif}
.preview-placeholder{padding:16px 10px;border:1px dashed var(--line,#ded7e5);border-radius:10px;color:var(--muted,#777);font-size:12px;text-align:center}
.preview-empty-pill{font-size:10px;background:var(--accent-soft,#f2eafb);padding:4px 7px;border-radius:20px}
.preview-demo-table td,.preview-demo-table th{white-space:nowrap}
.preview-demo-table .preview-client{font-weight:700}
.preview-toast{position:fixed;right:16px;bottom:20px;z-index:999;background:#281c35;color:#fff;border-radius:12px;box-shadow:0 12px 32px #0003;padding:13px 15px;max-width:300px;font:12px/1.4 Inter,system-ui,sans-serif}
.preview-toast[hidden]{display:none}
html[data-theme="dark"] .preview-warning{background:#483719;color:#fff0c8;border-bottom-color:#70562b}
html[data-theme="dark"] .preview-top{background:#100c16}
@media(max-width:680px){
 .preview-top{display:grid;grid-template-columns:1fr auto;padding:10px;gap:10px}
 .preview-brand{grid-column:1}.preview-theme{grid-column:2;grid-row:1}
 .preview-top nav{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .preview-top nav a{min-height:44px;font-size:13px}
 .preview-warning{padding:9px 11px;font-size:11px}
 .preview-foot{padding:14px 10px 32px}
}


/* Visual-only fixture layout.
 * The real dashboard runtime normally positions widgets via JS. In preview that
 * runtime is intentionally absent, so remove its absolute desktop geometry.
 * These overrides affect only generated Pages assets, never HUB production. */
body.workspace-mode-grid .workspace-surface {
  position:relative!important;width:100%!important;min-width:0!important;
  min-height:0!important;height:auto!important;display:grid!important;gap:11px
}
body.workspace-mode-grid .workspace-surface > .kpi-grid,
body.workspace-mode-grid .workspace-surface > .dashboard-grid {
  display:grid!important;position:relative!important;grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;height:auto!important;min-height:0!important;gap:11px!important;
  margin:0!important;padding:0!important
}
body.workspace-mode-grid .workspace-surface [data-widget] {
  display:block;position:relative!important;
  left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  width:100%!important;height:auto!important;max-width:100%!important;
  min-height:0!important;transform:none!important;margin:0!important;
  grid-column:1/-1!important;grid-row:auto!important
}
body.workspace-mode-grid .workspace-surface [data-widget] > .card-head {cursor:default!important}
/* The demo includes only functional-looking synthetic fixtures: empty backend-only
 * analytics and administrative controls are deliberately not presented as working. */
body.workspace-mode-grid .workspace-surface [data-widget]:not([data-widget="kpi_summary"]):not([data-widget="won_summary"]):not([data-widget="trend"]):not([data-widget="general_plan"]):not([data-widget="funnel"]):not([data-widget="managers"]):not([data-widget="telephony"]) {display:none!important}
body .page .source-card {display:none!important}
body .page .table-card {min-width:0;max-width:100%}
body .workspace-edit-bar {display:none!important}
body .workspace-resize-handle,body .workspace-drag-handle {display:none!important}
body .dashboard-screen-list {align-items:center}
body .preview-demo-table {background:var(--panel,#fff)}
body .preview-demo-table td,body .preview-demo-table th {font-size:12px}
body .preview-demo-chart {height:170px;display:flex;align-items:flex-end;justify-content:space-around;gap:8px;padding:12px 4px 0}
body .preview-demo-chart .preview-col {display:flex;flex-direction:column;justify-content:flex-end;gap:5px;height:100%;flex:1;min-width:0;text-align:center}
body .preview-demo-chart .preview-bar {display:block;border-radius:7px 7px 3px 3px;background:linear-gradient(180deg,#b175f1,#7431c8);min-height:6px}
body .preview-demo-chart .preview-caption {font-size:10px;color:var(--muted,#756d79)}
body .preview-demo-label {display:inline-block;margin-top:5px;color:var(--muted,#756d79);font-size:11px}
body .preview-demo-empty {padding:10px 0;color:var(--muted,#756d79);font-size:11px}
@media (min-width:900px) {
 body .exec-app,body .page {max-width:550px!important;margin:0 auto!important}
 body .preview-warning,body .preview-foot {text-align:center}
}


/* Preview navigation is two compact rows on phones, not a stretched toolbar. */
@media (max-width: 680px) {
  .preview-top {
    display:grid!important;grid-template-columns:minmax(0,1fr) 44px!important;
    align-items:center!important;align-content:start!important;
    justify-content:stretch!important;gap:6px 8px!important;
    min-height:0!important;height:auto!important;
    padding:8px 10px!important;
  }
  .preview-brand {grid-column:1;min-width:0}
  .preview-brand strong {font-size:12px;line-height:1.2}
  .preview-brand small {display:none}
  .preview-theme {grid-column:2;grid-row:1;justify-self:end;width:44px;height:44px}
  .preview-top nav {
    grid-column:1/-1;grid-row:2;width:100%;min-width:0;
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px!important;margin:0;
  }
  .preview-top nav a {
    width:100%;min-width:0;height:40px;min-height:40px;
    padding:0 8px;font-size:12px;line-height:1.2;
  }
  .preview-warning {font-size:10.5px;line-height:1.3;padding:7px 10px}
}


/* Preview shell: keep the brand, demo section switcher and theme on one row. */
@media (max-width:680px){
  .preview-top{
    display:flex!important;flex-flow:row nowrap!important;
    align-items:center!important;justify-content:space-between!important;
    gap:6px!important;height:auto!important;min-height:0!important;
    padding:7px 9px!important;
  }
  .preview-brand{display:flex;flex:0 0 auto;min-width:0;gap:5px}
  .preview-mark{flex:0 0 30px;width:30px;height:30px;border-radius:8px;font-size:16px}
  .preview-brand strong{font-size:10px;line-height:1.15;white-space:nowrap}
  .preview-brand small{display:none!important}
  .preview-top nav{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    flex:1 1 auto!important;width:auto!important;min-width:0!important;
    max-width:none!important;gap:5px!important;margin:0!important;
  }
  .preview-top nav a{
    min-width:0!important;max-width:100%!important;
    min-height:40px!important;height:40px!important;
    padding:0 4px!important;border-radius:9px;font-size:11px!important;
    line-height:1.1;white-space:nowrap!important;
  }
  .preview-theme{
    flex:0 0 40px!important;width:40px!important;min-width:40px!important;
    height:40px!important;min-height:40px!important;
    margin:0!important;align-self:center;
  }
}
@media (max-width:380px){
  .preview-brand strong{display:none!important}
}


/* Mobile 2.0: the preview bottom navigation mirrors the position of the
 * production HUB mobile tab bar. Production hub.css already has the bottom nav. */
.preview-bottom-nav{
  position:fixed;bottom:0;left:0;right:0;z-index:150;
  display:flex;align-items:stretch;justify-content:space-around;gap:6px;
  min-height:calc(65px + env(safe-area-inset-bottom,0px));
  padding:7px max(12px,env(safe-area-inset-left,0px))
    calc(7px + env(safe-area-inset-bottom,0px))
    max(12px,env(safe-area-inset-right,0px));
  border-top:1px solid var(--line,#e7dfe9);
  background:var(--panel,#fff);
  box-shadow:0 -7px 22px rgba(18,9,30,.10);
  -webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);
}
.preview-bottom-tab{
  display:flex;flex:1 1 0;flex-direction:column;gap:4px;
  align-items:center;justify-content:center;min-width:0;max-width:180px;
  min-height:48px;text-decoration:none;border-radius:12px;
  color:var(--muted,#756d79)!important;font:700 11px/1.15 Inter,system-ui,sans-serif;
}
.preview-bottom-tab svg{
  width:21px;height:21px;flex:0 0 21px;
  fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
.preview-bottom-tab[aria-current="page"]{
  background:var(--accent-soft,#f0e9fb)!important;
  color:var(--accent,#6f3cc3)!important;
}
.preview-bottom-tab:focus-visible{outline:2px solid var(--accent,#6f3cc3);outline-offset:2px}
body{padding-bottom:calc(75px + env(safe-area-inset-bottom,0px))!important}
.preview-foot{padding-bottom:20px!important}
body:has(.mobile-issuance-filters-dialog[open]) .preview-bottom-nav,
body:has(.mobile-filters-dialog[open]) .preview-bottom-nav{display:none!important}
@media(max-width:680px){
  .preview-top{
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    min-height:44px!important;padding:6px 11px!important;
  }
  .preview-brand{flex:1 1 auto!important;min-width:0}
  .preview-brand strong{font-size:12px;display:block!important}
  .preview-theme{flex:0 0 40px}
}
@media(max-width:360px){
  .preview-bottom-nav{gap:4px;padding-left:6px;padding-right:6px}
  .preview-brand strong{font-size:11px}
}
html[data-theme="dark"] .preview-bottom-nav{background:#201c26;border-top-color:#463d50}
