/* Matrix Företag – levande ledningspanel. Svart/grönt, glas, djup och rörelse. */
:root {
  --bg: #030605; --bg2: rgba(7, 14, 11, .78); --panel: rgba(11, 20, 16, .66); --panel-solid: #0b1410; --panel2: rgba(17, 30, 24, .8); --line: rgba(120, 255, 190, .09); --line2: rgba(120, 255, 190, .16);
  --text: #e8f5ee; --muted: #93ad9f; --dim: #607a6c;
  --green: #2ef09a; --green2: #19c477; --green3: #0b7a49; --greenbg: rgba(46, 240, 154, .09); --greenline: rgba(46, 240, 154, .38);
  --amber: #f5c451; --amberbg: rgba(245, 196, 81, .1); --red: #ff6f6f; --redbg: rgba(255, 111, 111, .1); --blue: #72c9ff; --bluebg: rgba(114, 201, 255, .1); --violet: #b79bff;
  --r: 16px; --r-sm: 10px; --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -24px rgba(0,0,0,.8);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { overflow-x: hidden; }
::selection { background: rgba(46, 240, 154, .3); }
a { color: var(--green); text-decoration: none; transition: color .2s; }
a:hover { color: #7dffc4; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 650; font-family: var(--display); letter-spacing: -.01em; }
h1 { font-size: 28px; letter-spacing: -.025em; font-weight: 700; } h2 { font-size: 17px; } h3 { font-size: 15px; }
h4 { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.wrap { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0; font: 12.5px/1.55 var(--mono); color: #cfe7da; max-height: 420px; overflow: auto; }

/* ---------- Levande bakgrund ---------- */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .9; }
.aurora { position: fixed; inset: -20vmax; z-index: 0; pointer-events: none; filter: blur(60px); opacity: .55; }
.aurora::before, .aurora::after { content: ""; position: absolute; border-radius: 50%; }
.aurora::before { width: 60vmax; height: 60vmax; left: 10%; top: 0; background: radial-gradient(circle, rgba(46,240,154,.16), transparent 60%); animation: drift1 26s var(--ease) infinite alternate; }
.aurora::after { width: 50vmax; height: 50vmax; right: 5%; bottom: 0; background: radial-gradient(circle, rgba(30,160,255,.09), transparent 60%); animation: drift2 32s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate(18vmax, 14vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vmax, -10vmax) scale(1.2); } }
.app, .topbar, .login { position: relative; z-index: 1; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr) 312px; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg2); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: conic-gradient(from 210deg, #0b7a49, var(--green), #b7ffe0, var(--green), #0b7a49); display: grid; place-items: center; color: #022014; font-weight: 800; font-family: var(--mono); position: relative; box-shadow: 0 0 24px -6px rgba(46,240,154,.7); animation: markspin 14s linear infinite; }
.brand-mark span { animation: markspin 14s linear infinite reverse; display: inline-block; }
@keyframes markspin { to { transform: rotate(360deg); } }
.brand b { font-size: 15px; letter-spacing: .01em; } .brand small { display: block; color: var(--dim); font-size: 11px; }
.nav { position: relative; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: var(--muted); font-weight: 500; transition: color .25s, background .25s, transform .25s var(--ease); }
.nav a:hover { background: rgba(255,255,255,.035); color: var(--text); transform: translateX(2px); }
.nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(46,240,154,.16), rgba(46,240,154,.03)); color: #b9ffdd; box-shadow: inset 0 0 0 1px rgba(46,240,154,.2); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--green); box-shadow: 0 0 12px var(--green); }
.nav .ico { width: 20px; text-align: center; opacity: .95; font-size: 14px; transition: transform .35s var(--spring); }
.nav a:hover .ico { transform: scale(1.18); }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
main { min-width: 0; padding: 26px 30px 70px; outline: none; }
.topbar { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin: 4px 0 0; max-width: 760px; }
.page-head h1 { background: linear-gradient(180deg, #fff, #a9d8c0); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Rörelse ---------- */
.reveal { opacity: 0; transform: translateY(14px) scale(.985); animation: rise .7s var(--ease) forwards; animation-delay: var(--d, 0ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.page-enter { animation: pagein .45s var(--ease); }
@keyframes pagein { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.shimmer { background: linear-gradient(90deg, var(--muted) 0%, #fff 45%, var(--muted) 90%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Radarpanel ---------- */
.radar { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-left: 1px solid var(--line); background: var(--bg2); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); padding: 18px 16px; }
.radar-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; }
.radar-scope { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--greenline); position: relative; overflow: hidden; flex: none; background: radial-gradient(circle, rgba(46,240,154,.1) 0 22%, transparent 23%), radial-gradient(circle, transparent 0 46%, rgba(46,240,154,.14) 47% 48%, transparent 49%), radial-gradient(circle, transparent 0 70%, rgba(46,240,154,.12) 71% 72%, transparent 73%); box-shadow: 0 0 30px -10px rgba(46,240,154,.6) inset; }
.radar-scope::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.radar-scope::before { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--green); left: 64%; top: 30%; box-shadow: 0 0 8px var(--green); opacity: 0; }
.radar-scope.searching::after { background: conic-gradient(from 0deg, rgba(46,240,154,.6), transparent 26%); animation: sweep 1.6s linear infinite; }
.radar-scope.searching::before { animation: blip 1.6s ease-out infinite; }
.radar-scope.armed::after { background: conic-gradient(from 0deg, rgba(46,240,154,.28), transparent 22%); animation: sweep 5s linear infinite; }
.radar-scope.off { border-color: var(--line2); filter: grayscale(1); opacity: .6; }
.radar-scope.err { border-color: var(--red); }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0%, 40% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12.5px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.radar section { border-top: 1px solid var(--line); padding-top: 11px; margin-top: 11px; }
.radar .radar-toggle, .radar-toggle { display: none; }

/* ---------- Komponenter ---------- */
.card { position: relative; background: var(--panel); backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; box-shadow: var(--shadow); transition: border-color .35s, transform .45s var(--ease), box-shadow .45s var(--ease); overflow-wrap: break-word; isolation: isolate; }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(46,240,154,.085), transparent 45%); z-index: -1; }
.card:hover::after { opacity: 1; }
.card:hover { border-color: var(--line2); }
a.card, button.card { color: inherit; display: block; }
.card.stat { display: flex; }
a.card:hover, button.card:hover { transform: translateY(-3px); box-shadow: var(--shadow), 0 18px 40px -20px rgba(46,240,154,.35); text-decoration: none; }
.card.tight { padding: 11px 13px; border-radius: 12px; }
.card h2, .card h3 { margin-bottom: 10px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat .v { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; font-family: var(--display); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.stat a { color: inherit; }
.card.stat::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(46,240,154,.5), transparent); opacity: .6; }
.btn { appearance: none; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); border-radius: 11px; padding: 7px 13px; font: 550 13px var(--font); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; min-height: 34px; transition: transform .25s var(--spring), border-color .2s, background .2s, box-shadow .3s; }
.btn:hover:not(:disabled) { border-color: var(--greenline); background: rgba(46,240,154,.08); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.primary { background: linear-gradient(180deg, #4dfab0, var(--green2)); color: #02160d; border-color: transparent; font-weight: 700; box-shadow: 0 8px 24px -10px rgba(46,240,154,.8), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #7dffc8, #2ee08f); box-shadow: 0 10px 30px -8px rgba(46,240,154,.9), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.danger { border-color: rgba(255,111,111,.45); color: var(--red); }
.btn.danger:hover:not(:disabled) { background: var(--redbg); border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; min-height: 28px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; background: rgba(255,255,255,.02); }
.badge.ok { color: var(--green); border-color: var(--greenline); background: var(--greenbg); }
.badge.warn { color: var(--amber); border-color: rgba(245,196,81,.4); background: var(--amberbg); }
.badge.err { color: var(--red); border-color: rgba(255,111,111,.4); background: var(--redbg); }
.badge.info { color: var(--blue); border-color: rgba(114,201,255,.35); background: var(--bluebg); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 8px rgba(46,240,154,.6); } .dot.warn { background: var(--amber); } .dot.err { background: var(--red); } .dot.info { background: var(--blue); }
.dot.live { background: var(--green); box-shadow: 0 0 0 0 rgba(46,240,154,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,240,154,.55); } 70% { box-shadow: 0 0 0 8px rgba(46,240,154,0); } 100% { box-shadow: 0 0 0 0 rgba(46,240,154,0); } }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
th { white-space: nowrap; color: var(--dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
td .mono, td.mono, td .dim, td .tiny { overflow-wrap: anywhere; }
tr.click { cursor: pointer; } tr.click td { transition: background .2s; } tr.click:hover td { background: rgba(46,240,154,.045); }
.table-wrap { overflow-x: auto; }
input, select, textarea { width: 100%; background: rgba(0,0,0,.32); color: var(--text); border: 1px solid var(--line2); border-radius: 11px; padding: 9px 11px; font: 14px var(--font); transition: border-color .2s, box-shadow .25s, background .2s; }
textarea { min-height: 90px; resize: vertical; font-family: var(--font); }
input:focus, select:focus, textarea:focus { border-color: var(--green2); outline: none; box-shadow: 0 0 0 4px rgba(46,240,154,.12); background: rgba(0,0,0,.45); }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field { margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); font-size: 13.5px; }
.check input { width: auto; margin-top: 3px; accent-color: var(--green); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; background: none; border: 0; color: var(--muted); padding: 9px 13px; font: 550 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: color .2s; }
.tabs button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--green); transform: scaleX(0); transition: transform .35s var(--ease); box-shadow: 0 0 10px var(--green); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: #b9ffdd; }
.tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.notice { border: 1px solid var(--line2); border-left: 3px solid var(--amber); background: var(--amberbg); border-radius: 12px; padding: 11px 13px; font-size: 13px; }
.notice.err { border-left-color: var(--red); background: var(--redbg); }
.notice.ok { border-left-color: var(--green); background: var(--greenbg); }
.notice.info { border-left-color: var(--blue); background: var(--bluebg); }
.empty { color: var(--dim); padding: 22px; text-align: center; border: 1px dashed var(--line2); border-radius: 14px; background: rgba(0,0,0,.12); }

/* ---------- Översikt: hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.hero-text { display: flex; flex-direction: column; justify-content: center; padding: 26px 28px; overflow: hidden; }
.hero-text .eyebrow { color: var(--green); font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.hero-text h1 { font-size: 40px; margin: 8px 0 8px; letter-spacing: -.035em; line-height: 1.05; background: linear-gradient(120deg, #fff 20%, #9dffd0 50%, #fff 80%); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 8s linear infinite; }
@keyframes sheen { to { background-position: -200% center; } }
.hero-text .lead { color: var(--muted); font-size: 15px; max-width: 520px; }
.hero-clock { font: 600 13px var(--mono); color: var(--dim); }
.pulse-line { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.pulse-line span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); }

/* ---------- Teamkarta ---------- */
.teammap { position: relative; padding: 0; overflow: hidden; min-height: 340px; }
.teammap svg { display: block; width: 100%; height: auto; margin-top: 34px; }
.teammap .tm-title { position: absolute; left: 18px; top: 14px; z-index: 2; }
.teammap .tm-legend { position: absolute; right: 16px; top: 14px; z-index: 2; display: flex; gap: 10px; }
.tm-ring { fill: none; stroke: rgba(46,240,154,.14); stroke-dasharray: 2 7; transform-origin: center; transform-box: fill-box; }
.tm-ring.r1 { animation: sweep 70s linear infinite; } .tm-ring.r2 { animation: sweep 110s linear infinite reverse; }
.tm-link { stroke: rgba(46,240,154,.16); stroke-width: 1; transition: stroke .4s; }
.tm-link.hot { stroke: rgba(46,240,154,.65); }
.tm-node { cursor: pointer; }
.tm-node .halo { fill: rgba(46,240,154,.06); stroke: rgba(46,240,154,.25); transition: all .4s; }
.tm-node .core { fill: #0a1712; stroke: rgba(46,240,154,.5); stroke-width: 1.2; transition: all .4s; }
.tm-node text { fill: #d8f5e6; font: 650 13px var(--font); text-anchor: middle; pointer-events: none; }
.tm-node .ini { fill: var(--green); font: 800 14px var(--mono); }
.tm-node .sub { fill: var(--dim); font: 500 11px var(--font); }
.tm-node.working .halo { fill: rgba(46,240,154,.14); stroke: var(--green); animation: breathe 1.8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.tm-node.working .core { stroke: var(--green); }
.tm-node.waiting .core { stroke: var(--amber); } .tm-node.blocked .core { stroke: var(--red); }
.tm-node:hover .core { stroke: #b9ffdd; }
.tm-node.ping .halo { animation: ping .9s var(--ease); transform-origin: center; transform-box: fill-box; }
@keyframes breathe { 50% { transform: scale(1.18); opacity: .6; } }
@keyframes ping { 0% { transform: scale(1); } 40% { transform: scale(1.28); stroke: #b9ffdd; } 100% { transform: scale(1); } }
.tm-packet { fill: #b9ffdd; filter: drop-shadow(0 0 6px #2ef09a); }
.tm-toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: 12px; color: var(--muted); background: rgba(0,0,0,.45); border: 1px solid var(--line); padding: 5px 11px; border-radius: 999px; max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .4s; }

/* Händelseflöde och kommunikation */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.feed time { color: var(--dim); font: 11.5px var(--mono); padding-top: 2px; }
.feed .who { font-weight: 650; color: #c6f7df; }
.feed .res { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.feed li.new { animation: slidein .7s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateX(-10px); background: var(--greenbg); } to { opacity: 1; transform: none; background: transparent; } }
.msg { border: 1px solid var(--line); border-radius: 13px; padding: 11px 13px; background: rgba(0,0,0,.18); transition: border-color .3s; }
.msg:hover { border-color: var(--line2); }
.msg + .msg { margin-top: 8px; }
.msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.msg-head .arrow { color: var(--green); }
.msg-body { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: #cfe7da; }
.msg-body.clamp { max-height: 8.5em; overflow: hidden; cursor: pointer; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.type-delegering { color: var(--blue); } .type-resultat { color: var(--green); } .type-granskning { color: var(--violet); } .type-rättning { color: var(--amber); } .type-eskalering { color: var(--red); } .type-förtydligande { color: #7fd7d0; }

/* Organisationsvy */
.org { display: flex; flex-direction: column; align-items: center; gap: 0; }
.org-top { width: min(380px, 100%); }
.org-line { width: 2px; height: 22px; background: linear-gradient(var(--green), transparent); }
.org-bus { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--greenline), transparent); max-width: 92%; }
.org-team { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; margin-top: 18px; }
.agent { cursor: pointer; text-align: left; width: 100%; color: inherit; font: inherit; position: relative; }
.agent.working { border-color: var(--greenline); box-shadow: var(--shadow), 0 0 0 1px rgba(46,240,154,.12), 0 0 40px -16px var(--green); }
.agent.working::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, var(--green) 85%, transparent 100%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: orbit 3s linear infinite; pointer-events: none; }
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes orbit { to { --ang: 360deg; } }
.agent .av { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: radial-gradient(circle at 30% 25%, rgba(46,240,154,.25), rgba(0,0,0,.3)); border: 1px solid var(--line2); color: var(--green); font-family: var(--mono); flex: none; transition: transform .4s var(--spring); }
.agent:hover .av { transform: rotate(-6deg) scale(1.08); }
.agent .role { color: var(--muted); font-size: 12px; }
.agent .now { font-size: 12.5px; margin-top: 9px; color: var(--text); min-height: 2.6em; overflow-wrap: anywhere; }
.agent .meta { display: flex; justify-content: space-between; color: var(--dim); font-size: 11.5px; margin-top: 7px; gap: 6px; flex-wrap: wrap; }

/* Flödesstapel */
.pipeline { display: flex; gap: 5px; flex-wrap: wrap; }
.pipeline span { font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); transition: all .4s; }
.pipeline span.done { color: var(--green2); border-color: rgba(25,196,119,.35); background: rgba(25,196,119,.06); }
.pipeline span.cur { color: #02160d; background: linear-gradient(180deg, #4dfab0, var(--green2)); border-color: transparent; font-weight: 700; box-shadow: 0 0 18px -4px var(--green); }

/* ---------- Chatt med chefen (Atlas) ---------- */
.chat-shell { display: flex; flex-direction: column; height: calc(100vh - 52px); min-height: 480px; margin: -26px -30px -70px; }
.chat-top { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: rgba(3,6,5,.55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 3; }
.chat-top.page-head { margin: 0; align-items: center; flex-wrap: nowrap; justify-content: flex-start; }
.chat-top .who { min-width: 0; } .chat-top .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-top .who b { font-size: 15px; } .chat-top .who div { font-size: 12px; color: var(--muted); }
.orb { width: 38px; height: 38px; border-radius: 50%; flex: none; position: relative; background: radial-gradient(circle at 35% 30%, #c9ffe6, #2ef09a 35%, #0b7a49 70%, #03140c); box-shadow: 0 0 22px -4px rgba(46,240,154,.8); }
.orb::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(46,240,154,.35); animation: breathe 3s ease-in-out infinite; }
.orb.busy::after { animation: breathe .9s ease-in-out infinite; border-color: var(--green); }
.orb.big { width: 92px; height: 92px; box-shadow: 0 0 70px -10px rgba(46,240,154,.8); }
.orb.big::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, rgba(46,240,154,.35), transparent 40%); animation: sweep 4s linear infinite; -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); }
.chat-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.chat-col { max-width: 780px; margin: 0 auto; padding: 26px 22px 30px; display: flex; flex-direction: column; gap: 22px; }
.chat-welcome { text-align: center; padding: 6vh 0 10px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.chat-welcome h2 { font-size: 30px; letter-spacing: -.03em; margin: 10px 0 0; }
.chat-welcome p { color: var(--muted); max-width: 480px; margin: 0; }
.suggest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 14px; }
.suggest button { text-align: left; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 13px 15px; font: 13.5px var(--font); cursor: pointer; transition: transform .35s var(--ease), border-color .25s, background .25s; }
.suggest button:hover { transform: translateY(-2px); border-color: var(--greenline); background: rgba(46,240,154,.06); }
.suggest button small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.cmsg { display: flex; gap: 12px; animation: rise .5s var(--ease) both; }
.cmsg.user { justify-content: flex-end; }
.cmsg.user .cbody { background: linear-gradient(180deg, rgba(46,240,154,.14), rgba(46,240,154,.07)); border: 1px solid rgba(46,240,154,.25); padding: 10px 15px; border-radius: 18px 18px 6px 18px; max-width: 82%; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmsg.assistant .cbody, .cmsg.system .cbody { flex: 1; min-width: 0; padding-top: 6px; }
.cmsg .orb { width: 30px; height: 30px; margin-top: 2px; }
.cmsg.system .cbody { background: var(--redbg); border: 1px solid rgba(255,111,111,.3); border-radius: 14px; padding: 10px 14px; }
.cdivider { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; }
.cdivider::before, .cdivider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.md { font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.md p { margin: 0 0 .7em; } .md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: .2em 0 .8em; padding-left: 1.3em; } .md li { margin: .2em 0; }
.md h1, .md h2, .md h3 { font-size: 16px; margin: .9em 0 .4em; -webkit-text-fill-color: currentColor; background: none; }
.md code { background: rgba(46,240,154,.08); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 12.5px; }
.md pre code { background: none; border: 0; padding: 0; }
.md strong { color: #fff; }
.steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.step { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.step .si { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; flex: none; border: 1px solid var(--line2); }
.step.ok .si { background: var(--greenbg); color: var(--green); border-color: var(--greenline); }
.step.fail .si { background: var(--redbg); color: var(--red); border-color: rgba(255,111,111,.4); }
.step.run .si { border-color: var(--green); border-top-color: transparent; animation: sweep .8s linear infinite; }
.toolcall { margin: 2px 0 0 27px; font-size: 12px; color: var(--muted); }
.toolcall summary { cursor: pointer; list-style: none; color: var(--dim); }
.toolcall summary::-webkit-details-marker { display: none; }
.toolcall[open] summary { color: var(--muted); }
.cactions { display: flex; gap: 4px; margin-top: 8px; opacity: .0; transition: opacity .25s; align-items: center; flex-wrap: wrap; }
.cmsg:hover .cactions, .cmsg:focus-within .cactions, .cmsg.last .cactions { opacity: 1; }
.cactions button { background: none; border: 0; color: var(--dim); font: 12px var(--font); padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.cactions button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.composer-wrap { padding: 10px 22px 18px; background: linear-gradient(transparent, rgba(3,6,5,.85) 30%); }
.composer { max-width: 780px; margin: 0 auto; background: rgba(12,22,17,.85); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line2); border-radius: 22px; padding: 10px 10px 10px 16px; display: flex; align-items: flex-end; gap: 8px; box-shadow: 0 20px 50px -25px rgba(0,0,0,.9), 0 0 0 0 rgba(46,240,154,0); transition: border-color .25s, box-shadow .35s; }
.composer:focus-within { border-color: var(--greenline); box-shadow: 0 20px 50px -25px rgba(0,0,0,.9), 0 0 0 4px rgba(46,240,154,.08); }
.composer textarea { flex: 1; border: 0; background: none; min-height: 26px; max-height: 220px; height: 26px; padding: 6px 0; resize: none; font-size: 15px; line-height: 1.5; box-shadow: none; }
.composer textarea:focus { box-shadow: none; background: none; }
.cbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(255,255,255,.03); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; font-size: 16px; transition: transform .25s var(--spring), background .2s, border-color .2s; }
.cbtn:hover:not(:disabled) { border-color: var(--greenline); background: rgba(46,240,154,.08); }
.cbtn:active:not(:disabled) { transform: scale(.9); }
.cbtn.send { background: linear-gradient(180deg, #4dfab0, var(--green2)); color: #02160d; border-color: transparent; font-weight: 800; }
.cbtn.send:disabled { background: rgba(255,255,255,.06); color: var(--dim); }
.cbtn.mic.rec { background: var(--red); border-color: var(--red); color: #fff; animation: recpulse 1.4s infinite; }
@keyframes recpulse { 0% { box-shadow: 0 0 0 0 rgba(255,111,111,.6); } 70% { box-shadow: 0 0 0 12px rgba(255,111,111,0); } 100% { box-shadow: 0 0 0 0 rgba(255,111,111,0); } }
.wave { display: none; align-items: center; gap: 3px; height: 26px; padding: 0 4px; }
.composer.recording .wave { display: inline-flex; }
.wave i { width: 3px; border-radius: 3px; background: var(--red); height: 6px; animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; } .wave i:nth-child(5) { animation-delay: .4s; }
@keyframes wave { 50% { height: 22px; } }
.composer-hint { max-width: 780px; margin: 7px auto 0; color: var(--dim); font-size: 11.5px; text-align: center; }

/* Låda/dialog */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 40; animation: fadein .3s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(740px, 100%); background: rgba(6,12,9,.94); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-left: 1px solid var(--line2); z-index: 41; overflow-y: auto; padding: 20px 22px 40px; animation: drawerin .5s var(--ease); box-shadow: -30px 0 80px -20px rgba(0,0,0,.8); }
@keyframes drawerin { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } }
.drawer-close { position: sticky; top: 0; float: right; z-index: 2; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(14,26,20,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line2); padding: 11px 16px; border-radius: 14px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: toastin .5s var(--spring); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } }
.toast.err { border-color: rgba(255,111,111,.5); } .toast.ok { border-color: var(--greenline); }

/* Kommandopalett */
.pal-open { width: 100%; justify-content: flex-start; margin-bottom: 8px; color: var(--muted); }
.palette { position: fixed; left: 50%; top: 14vh; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); z-index: 61; background: rgba(8,16,12,.96); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 40px 100px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(46,240,154,.06); overflow: hidden; animation: palin .35s var(--spring); }
@keyframes palin { from { opacity: 0; transform: translate(-50%, -10px) scale(.97); } }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; background: none; }
.palette input:focus { box-shadow: none; background: none; }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pal-list button { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 10px 12px; border-radius: 10px; font: 14px var(--font); cursor: pointer; }
.pal-list button[aria-selected="true"], .pal-list button:hover { background: rgba(46,240,154,.1); color: #b9ffdd; }
.pal-list .ico { width: 20px; text-align: center; color: var(--green); }
.pal-hint { padding: 8px 16px 10px; border-top: 1px solid var(--line); }
.palette-bg { z-index: 60; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(420px, 100%); padding: 30px 28px; animation: rise .8s var(--ease) both; }
.login .orb { margin: 0 auto 16px; }

/* Responsivt */
@media (max-width: 1280px) {
  .app { grid-template-columns: 232px minmax(0, 1fr); }
  .radar { position: fixed; top: 0; right: 0; width: min(350px, 100%); z-index: 45; transform: translateX(100%); transition: transform .45s var(--ease); box-shadow: -10px 0 40px rgba(0,0,0,.6); background: rgba(6,12,9,.95); }
  .radar.open { transform: none; }
  .radar .radar-toggle, .radar-toggle { display: inline-flex; }
  .org-team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { position: fixed; z-index: 44; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .18s cubic-bezier(.2,.8,.2,1); box-shadow: 10px 0 40px rgba(0,0,0,.6); background: rgba(6,12,9,.96); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; background: rgba(3,6,5,.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); padding: 8px 16px; align-items: center; gap: 8px; }
  main { padding: 18px 16px 70px; }
  h1 { font-size: 24px; }
  .hero-text { padding: 20px; } .hero-text h1 { font-size: 30px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .g4.keep2, .g3.keep2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 24px; }
  .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10,19,15,.9); }
  .aurora { opacity: .35; }
  .org-team { grid-template-columns: minmax(0, 1fr); }
  .chat-shell { margin: -18px -16px -70px; height: calc(100vh - 52px); height: calc(100dvh - 52px); }
  .chat-top { padding: 10px 14px; }
  .chat-col { padding: 18px 14px 20px; }
  .composer-wrap { padding: 8px 10px 12px; }
  .suggest { grid-template-columns: minmax(0, 1fr); }
  .cmsg.user .cbody { max-width: 90%; }
  .hide-m { display: none; }
  .feed li { grid-template-columns: 50px 1fr; }
  .teammap { min-height: 0; }
  .teammap .tm-legend { display: none; }
}
@media (min-width: 861px) { .chat-shell { height: 100vh; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =================== Uppgradering 2026-10-25 =================== */
/* Vatten: vågor i statistikkort och mätare */
.card.stat { overflow: hidden; }
.card.stat::after { opacity: 1 !important; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M0 10 Q25 2 50 10 T100 10 T150 10 T200 10 V20 H0Z' fill='%232ef09a' fill-opacity='.07'/%3E%3C/svg%3E") repeat-x bottom / 200px 22px, radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(46,240,154,.06), transparent 45%); animation: wavex 7s linear infinite; }
@keyframes wavex { to { background-position: 200px bottom, center; } }
.liquid { position: relative; height: 112px; border-radius: 14px; overflow: hidden; background: rgba(0,0,0,.35); border: 1px solid var(--line2); }
.liquid svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.liquid .w1, .liquid .w2 { fill: rgba(46,240,154,.32); transform-box: view-box; animation: lq 3.2s linear infinite; }
.liquid .w2 { fill: rgba(46,240,154,.18); animation-duration: 5s; animation-direction: reverse; }
.liquid.warn .w1 { fill: rgba(245,196,81,.35); } .liquid.warn .w2 { fill: rgba(245,196,81,.18); }
.liquid.blue .w1 { fill: rgba(114,201,255,.32); } .liquid.blue .w2 { fill: rgba(46,240,154,.16); }
@keyframes lq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.lq-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.lq-txt b { font: 700 26px var(--display); letter-spacing: -.02em; } .lq-txt span { font-size: 12px; color: #d6efe2; text-align: center; padding: 0 8px; }
.card .liquid + .tiny { display: block; }

/* Förlopp */
.progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; margin-top: 8px; position: relative; }
.progress.sm { height: 3px; margin-top: 6px; }
.progress.indeterminate i { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--green), transparent); animation: indet 1.4s var(--ease) infinite; }
@keyframes indet { from { left: -40%; } to { left: 100%; } }

/* Stor radar */
.radarhero { margin-top: 0; overflow: hidden; }
.rh-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: center; }
.rh-scope svg { width: 100%; max-width: 440px; display: block; margin: 0 auto; overflow: visible; }
.rh-ring { fill: none; stroke: rgba(46,240,154,.16); stroke-width: 1; }
.rh-sweep { transform-origin: 200px 200px; animation: sweep 5s linear infinite; }
.rh-scope.searching .rh-sweep { animation-duration: 1.8s; }
.rh-scope.off .rh-sweep { display: none; } .rh-scope.err .rh-ring { stroke: rgba(255,111,111,.25); }
.rh-beam { stroke: #9dffd0; stroke-width: 1.5; filter: drop-shadow(0 0 6px #2ef09a); }
.rh-src circle { fill: #0a1712; stroke: var(--green2); stroke-width: 1.5; }
.rh-src .ring { fill: none; stroke: rgba(46,240,154,.25); }
.rh-src text { fill: var(--muted); font: 600 10.5px var(--font); text-anchor: middle; }
.rh-src.active circle:first-child { fill: var(--green); } .rh-src.active .ring { stroke: var(--green); animation: breathe 1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; } .rh-src.active text { fill: #d8fff0; }
.rh-src.err circle { stroke: var(--red); } .rh-src.off { opacity: .35; }
.rh-dot circle { fill: rgba(255,111,111,.55); }
.rh-dot.g circle { fill: var(--blue); filter: drop-shadow(0 0 4px var(--blue)); }
.rh-dot.q circle { fill: var(--green); filter: drop-shadow(0 0 7px var(--green)); }
.rh-dot.q { animation: blink 2.4s ease-in-out infinite; }
.rh-dot.fresh circle { animation: pop .9s var(--spring); transform-box: fill-box; transform-origin: center; }
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.8); } to { transform: scale(1); } }
@keyframes blink { 50% { opacity: .55; } }
.rh-core circle { fill: #0a1712; stroke: var(--green); stroke-width: 1.5; filter: drop-shadow(0 0 10px rgba(46,240,154,.6)); }
.rh-core text { fill: var(--green); font: 800 15px var(--mono); text-anchor: middle; }
.rh-now { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.rh-big { font: 700 24px var(--display); letter-spacing: -.02em; color: #d8fff0; margin: 2px 0; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.fn-row { display: grid; grid-template-columns: 130px 1fr 36px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.fn-row b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.fn-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.05); overflow: hidden; }
.fn-bar i { display: block; height: 100%; border-radius: 6px; transition: width 1s var(--ease); background: linear-gradient(90deg, var(--green3), var(--green)); position: relative; overflow: hidden; }
.fn-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: indet 2.2s linear infinite; width: 40%; }
.fn-bar i.b { background: linear-gradient(90deg, #0b6e52, #4dfab0); } .fn-bar i.c { background: linear-gradient(90deg, #1d4e7a, var(--blue)); } .fn-bar i.d { background: linear-gradient(90deg, #6b5a12, var(--amber)); } .fn-bar i.e { background: linear-gradient(90deg, #4a2f8a, var(--violet)); }
.route { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; color: var(--dim); }
.route span { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); background: rgba(0,0,0,.2); }
.lg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 3px 0 8px; vertical-align: middle; }
.lg.q { background: var(--green); } .lg.g { background: var(--blue); } .lg.x { background: rgba(255,111,111,.6); }

/* Högerpanelen */
.radar-scope.big { width: 76px; height: 76px; }
.rstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.rstats div { background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 10px; padding: 7px 6px; text-align: center; }
.rstats b { display: block; font: 700 17px var(--display); } .rstats span { font-size: 10px; color: var(--dim); line-height: 1.2; display: block; }
.find { display: flex; flex-direction: column; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 6px; color: var(--text); font-size: 12.5px; border-left: 3px solid var(--dim); transition: background .2s, transform .3s var(--ease); }
.find:hover { background: rgba(46,240,154,.05); transform: translateX(2px); color: var(--text); }
.find.q { border-left-color: var(--green); } .find.g { border-left-color: var(--blue); } .find.x { border-left-color: rgba(255,111,111,.5); }
.rej { margin-bottom: 7px; } .rej-bar { height: 5px; border-radius: 4px; background: rgba(255,255,255,.05); overflow: hidden; margin-top: 3px; } .rej-bar i { display: block; height: 100%; background: linear-gradient(90deg, rgba(255,111,111,.4), rgba(255,111,111,.85)); border-radius: 4px; transition: width .8s var(--ease); }
.errbox { padding: 6px 8px; border-radius: 9px; background: var(--redbg); margin-bottom: 6px; }
.ok-line { color: var(--green); }
.srcrow { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.srcrow.off { opacity: .5; }

/* Notiser */
.bell { position: relative; font-size: 14px; }
.bell.ring { animation: bellring .9s var(--ease); }
@keyframes bellring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-16deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } }
.bell-count { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 700 10.5px var(--font); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-panel { position: fixed; top: 58px; left: 16px; width: min(420px, calc(100% - 32px)); max-height: min(70vh, 640px); z-index: 70; background: rgba(8,16,12,.97); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); display: flex; flex-direction: column; animation: palin .35s var(--spring); }
@media (min-width: 861px) { .notif-panel { left: 260px; top: 16px; } }
.np-head { display: flex; gap: 6px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.np-desk { margin: 10px 14px 0; }
.np-list { overflow-y: auto; padding: 8px; }
.np-item { display: flex; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid transparent; transition: background .2s; }
.np-item:hover { background: rgba(255,255,255,.03); }
.np-item.read { opacity: .55; }
.np-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--greenbg); color: var(--green); font-size: 12px; }
.sev-warning .np-ic { background: var(--amberbg); color: var(--amber); } .sev-error .np-ic { background: var(--redbg); color: var(--red); }
.np-acts { display: flex; flex-direction: column; gap: 2px; }
.np-acts button { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.np-acts button:hover { color: var(--text); background: rgba(255,255,255,.06); }
#ntoasts { position: fixed; top: 16px; right: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100% - 32px)); }
.ntoast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: rgba(10,20,15,.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--greenline); box-shadow: 0 20px 50px -15px rgba(0,0,0,.9); cursor: pointer; animation: ntin .55s var(--spring); }
.ntoast.sev-warning { border-color: rgba(245,196,81,.5); } .ntoast.sev-error { border-color: rgba(255,111,111,.55); }
.ntoast button { background: none; border: 0; color: var(--dim); cursor: pointer; }
.ntoast.out { animation: ntout .45s var(--ease) forwards; }
@keyframes ntin { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes ntout { to { opacity: 0; transform: translateX(40px); } }

/* Vem gör vad */
.who-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.who { display: flex; gap: 11px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.2); color: var(--text); font: inherit; cursor: pointer; position: relative; transition: border-color .3s, transform .35s var(--ease), background .3s; }
.who:hover { transform: translateY(-2px); border-color: var(--line2); }
.who .av { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font: 800 13px var(--mono); color: var(--green); background: radial-gradient(circle at 30% 25%, rgba(46,240,154,.25), rgba(0,0,0,.3)); border: 1px solid var(--line2); flex: none; }
.who.working { border-color: var(--greenline); background: rgba(46,240,154,.05); box-shadow: 0 0 30px -14px var(--green); }
.who.working .av { animation: breathe 1.6s ease-in-out infinite; }
.who.waiting { border-color: rgba(245,196,81,.35); } .who.blocked { border-color: rgba(255,111,111,.4); }
.who-now { margin-top: 5px; color: #cfe7da; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.who-q { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--amber); }

/* Live-kommunikation */
.comms { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; padding-right: 4px; }
.comm { display: flex; gap: 12px; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--line); background: rgba(0,0,0,.18); }
.comm.new { animation: commin .8s var(--spring); border-color: var(--greenline); }
@keyframes commin { from { opacity: 0; transform: translateY(-12px) scale(.98); background: rgba(46,240,154,.12); } }
.comm-avs { display: flex; align-items: center; gap: 4px; flex: none; }
.comm-avs .av { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font: 800 11px var(--mono); color: var(--green); background: rgba(46,240,154,.08); border: 1px solid var(--line2); }
.comm-arrow { font-size: 12px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(3px); } }
.comm-body { margin-top: 3px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Uppdragstavla */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.lane { background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-height: 160px; scroll-snap-align: start; }
.lane-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; font-size: 13px; }
.kcard { display: block; padding: 11px 12px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; color: var(--text); transition: transform .35s var(--ease), border-color .25s, box-shadow .35s; animation: rise .5s var(--ease) both; }
.kcard:hover { transform: translateY(-3px); border-color: var(--greenline); box-shadow: 0 14px 30px -18px rgba(46,240,154,.5); color: var(--text); text-decoration: none; }
.kcard.running { border-color: var(--greenline); box-shadow: 0 0 24px -12px var(--green); }
.kcard.blocked { border-color: rgba(255,111,111,.35); }
.lane-empty { text-align: center; padding: 16px 0; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 11px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--muted); padding: 7px 12px; font: 550 13px var(--font); cursor: pointer; }
.seg button.on { background: rgba(46,240,154,.12); color: #b9ffdd; }

/* Säljpaket */
.presale { border-color: rgba(46,240,154,.25); }
.ps-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.ps-steps > span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line2); color: var(--dim); font-size: 12.5px; }
.ps-steps > span .av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 800 10px var(--mono); background: rgba(255,255,255,.05); }
.ps-steps > span.done { color: #b9ffdd; border-color: var(--greenline); background: var(--greenbg); } .ps-steps > span.done .av { background: var(--green); color: #02160d; }
.ps-steps > i { width: 18px; height: 1px; background: var(--line2); }
.ps-pkg { max-height: 360px; font-family: var(--font); font-size: 13.5px; line-height: 1.6; }

/* Flöden */
.flow { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 8px 2px; }
.flow-node { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 110px; text-align: center; }
.flow-node .av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 800 14px var(--mono); color: var(--green); border: 1px solid var(--line2); background: rgba(0,0,0,.3); }
.flow-node.has .av { border-color: var(--green); box-shadow: 0 0 22px -6px var(--green); animation: breathe 2s ease-in-out infinite; }
.flow-node b { font: 700 20px var(--display); }
.flow-pipe { flex: 1; min-width: 40px; height: 2px; background: var(--line2); position: relative; overflow: hidden; margin-bottom: 38px; }
.flow-pipe i { position: absolute; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: flowdot 2.4s linear infinite; }
.flow-pipe i:nth-child(2) { animation-delay: .8s; } .flow-pipe i:nth-child(3) { animation-delay: 1.6s; }
@keyframes flowdot { from { left: -6px; } to { left: 100%; } }
.integ svg { width: 100%; display: block; max-height: 300px; }
.ilink { fill: none; stroke: rgba(46,240,154,.35); stroke-width: 1.5; }
.ilink.err { stroke: rgba(255,111,111,.45); stroke-dasharray: 5 6; } .ilink.off { stroke: rgba(255,255,255,.12); stroke-dasharray: 2 6; }
.ipkt { fill: #b9ffdd; filter: drop-shadow(0 0 5px #2ef09a); } .ipkt.b { fill: var(--blue); }
.icore circle { fill: #0a1712; stroke: var(--green); stroke-width: 2; filter: drop-shadow(0 0 14px rgba(46,240,154,.7)); }
.icore text { fill: var(--green); font: 800 22px var(--mono); text-anchor: middle; }
.inode circle { fill: #0a1712; stroke: var(--green2); stroke-width: 1.5; }
.inode.err circle { stroke: var(--red); } .inode.off circle { stroke: var(--line2); }
.inode text { fill: var(--green); font: 800 12px var(--mono); text-anchor: middle; }
.inode.err text { fill: var(--red); } .inode.off text { fill: var(--dim); }
.inode .lbl { fill: var(--text); font: 650 12px var(--font); } .inode .sub { fill: var(--dim); font: 500 10px var(--font); }
.inode.ok circle { animation: breathe 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* Radarfilter */
.oppbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.oppbar input { flex: 2; min-width: 180px; } .oppbar select { flex: 1; min-width: 150px; width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { background: rgba(255,111,111,.06); border: 1px solid rgba(255,111,111,.25); color: var(--muted); border-radius: 999px; padding: 4px 10px; font: 12px var(--font); cursor: pointer; transition: all .2s; }
.chip.on, .chip:hover { color: var(--text); border-color: var(--red); }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .35s var(--ease), opacity .3s, margin .3s; }
.bulkbar.on { max-height: 120px; opacity: 1; margin-bottom: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(46,240,154,.06); border: 1px solid var(--greenline); }
.cav { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--display); color: #02160d; background: linear-gradient(135deg, #4dfab0, var(--green3)); flex: none; }
.goalrow .goal { border-color: rgba(114,201,255,.22); }

@media (max-width: 1280px) { .who-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .rh-grid { grid-template-columns: minmax(0, 1fr); }
  .rh-scope svg { max-width: 320px; }
  .who-board { grid-template-columns: minmax(0, 1fr); }
  .fn-row { grid-template-columns: 110px 1fr 30px; }
  .kanban { grid-auto-columns: minmax(78vw, 1fr); }
  .rstats b { font-size: 15px; }
  .flow-node { min-width: 84px; }
}
.rej-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }

/* Utkorg och inkorg */
.mailcard { margin-bottom: 12px; }
.mailcard.open { border-color: rgba(245,196,81,.3); }
.mailcard.reply { border-color: rgba(114,201,255,.3); }
.mailcard.in.unread { border-color: var(--greenline); box-shadow: 0 0 30px -16px var(--green); }
.mailcard .env { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--greenbg); color: var(--green); font-size: 14px; animation: breathe 3s ease-in-out infinite; }
.ob-form { margin-top: 10px; }
.send-btn:not(:disabled) { animation: sendglow 2.4s ease-in-out infinite; }
@keyframes sendglow { 50% { box-shadow: 0 8px 30px -6px rgba(46,240,154,1), inset 0 1px 0 rgba(255,255,255,.4); } }
.mailcard.flyaway { animation: flyaway .7s var(--ease) forwards; }
@keyframes flyaway { 40% { transform: translate(0, -6px) scale(1.01); } 100% { transform: translate(120%, -40px) rotate(6deg); opacity: 0; } }
