/*
 * Colour Impressions look for Images Pro
 * ------------------------------------------------------------------------
 * Same visual language as CI Plant (ci-plant.vercel.app): a "liquid glass"
 * light theme (one plain white canvas, white frosted panels with a bright rim
 * and top sheen; the sidebar stays as in dark mode), SF / Inter type and the iOS-blue brand
 * button. Loaded last so it sits on top of the ERP's own
 * styles. Dark mode keeps the ERP's dark theme.
 */
:root:not([data-theme="dark"]) {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, .10);
  --accent-edge: rgba(0, 122, 255, .32);
  --ci-glass:
    radial-gradient(120% 60% at 18% 0%, rgba(255,255,255,.55), transparent 62%),
    linear-gradient(160deg, rgba(255,255,255,.92), rgba(255,255,255,.78) 50%, rgba(255,255,255,.70));
  --ci-glass-shadow: inset 0 1.5px 0 rgba(255,255,255,.95), inset 1px 0 0 rgba(255,255,255,.65), inset -1px 0 0 rgba(255,255,255,.30),
    inset 0 -1px 0 rgba(255,255,255,.40), inset 0 10px 22px -14px rgba(255,255,255,.9), inset 0 -22px 38px -26px rgba(0,0,0,.06),
    0 0 0 .5px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04), 0 22px 48px -18px rgba(0,0,0,.14);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body { color: #1d1d1f; }
}

:root:not([data-theme="dark"]) body {
  background:
    #f5f6f8 !important;
  background-attachment: fixed !important;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background-attachment: fixed; }
}

/* frosted panels */
:root:not([data-theme="dark"]) .card,
:root:not([data-theme="dark"]) .kpi:not(.hero),
:root:not([data-theme="dark"]) .col,
:root:not([data-theme="dark"]) .dcard {
  background-color: transparent !important;
  background-image: var(--ci-glass) !important;
  -webkit-backdrop-filter: blur(30px) saturate(185%) brightness(1.04) !important;
  backdrop-filter: blur(30px) saturate(185%) brightness(1.04) !important;
  border: 1px solid rgba(255,255,255,.70) !important;
  box-shadow: var(--ci-glass-shadow) !important;
}

/* every tile gets a left colour bar in the colour of its number */
.kpi { --kc: var(--ink); }
.kpi.hero { --kc: var(--accent); }
.kpi.good { --kc: var(--good); }
.kpi.warn { --kc: var(--warn); }
.kpi.bad { --kc: var(--bad); }
html body .kpi:not(#_) { border-left: 3px solid var(--kc) !important; }

/* glass chips, ghost buttons and the mobile bar */
:root:not([data-theme="dark"]) .btn.ghost,
:root:not([data-theme="dark"]) .mbar {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.75)) !important;
  border: 1px solid rgba(255,255,255,.80) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 .5px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.06), 0 6px 16px -8px rgba(0,0,0,.14) !important;
}

/* brand button */
:root:not([data-theme="dark"]) .btn:not(.ghost):not(.danger):not(.green):not(.small.ghost),
:root:not([data-theme="dark"]) .topbtn {
  color: #fff;
  background-image: linear-gradient(180deg, #2e95ff, #007aff 55%, #0070ee) !important;
  border: 1px solid rgba(0,100,210,.45) !important;
  box-shadow: 0 8px 20px rgba(0,122,255,.32), inset 0 1px rgba(255,255,255,.42), inset 0 -1px rgba(0,83,173,.3);
  transition: transform .18s cubic-bezier(.32,.72,0,1), box-shadow .18s cubic-bezier(.32,.72,0,1);
}
:root:not([data-theme="dark"]) .btn:not(.ghost):not(.danger):active { transform: scale(.98); }

/* workspace settings link in the sidebar footer */
.navws { display: block; text-decoration: none; text-align: left; margin-bottom: 6px; color: #fff !important; border-color: rgba(255,255,255,.22) !important; background: rgba(255,255,255,.08) !important; }
.navws:hover { background: rgba(255,255,255,.16) !important; }

/* lost connection: a thin amber line at the top */
html.ip-offline body::before {
  content: "Reconnecting…"; position: fixed; z-index: 9999; top: 0; left: 0; right: 0;
  font: 600 11px var(--font); text-align: center; color: #fff; background: #ff9f0a; padding: 2px 0;
}
