/* Live overzicht watermonsters: statustegels, opdrachtenlijst en kaart. */

.sov {
    --sov-planned: #94a3b8; --sov-opened: #3b82f6; --sov-busy: #f59e0b; --sov-ready: #8b5cf6;
    --sov-submitted: #10b981; --sov-done: #10b981; --sov-problem: #ef4444;
    --sov-surface: #ffffff; --sov-surface-2: #f8fafc; --sov-line: #e2e8f0; --sov-text: #0f172a; --sov-muted: #64748b;
    --sov-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --sov-radius: 16px;
    display: flex; flex-direction: column; gap: 14px; color: var(--sov-text);
}
[data-theme="dark"] .sov {
    --sov-surface: #111827; --sov-surface-2: #0b1220; --sov-line: #1f2937; --sov-text: #e5e7eb; --sov-muted: #94a3b8;
    --sov-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}
.sov:fullscreen { background: var(--sov-surface-2); padding: 20px; height: 100vh; box-sizing: border-box; overflow: hidden; }
.sov svg.sov-ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* Kopregel */
.sov-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sov-title { display: flex; align-items: center; gap: 12px; }
.sov-title h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; }
.sov-title small { color: var(--sov-muted); font-size: .8rem; }
.sov-livedot { width: 10px; height: 10px; border-radius: 50%; background: var(--sov-done); box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
               animation: sov-live 2s ease-out infinite; }
.sov-livedot.is-stale { background: var(--sov-planned); animation: none; }
.sov-actions { display: flex; gap: 8px; }
.sov-iconbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--sov-line);
               background: var(--sov-surface); color: var(--sov-text); cursor: pointer; font: inherit; font-size: .85rem; box-shadow: var(--sov-shadow);
               transition: transform .15s, border-color .15s; }
.sov-iconbtn:hover { transform: translateY(-1px); border-color: var(--sov-opened); }
.sov-iconbtn.is-spinning svg { animation: sov-spin .8s linear infinite; }

/* Statustegels */
.sov-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.sov-tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--sov-surface);
            border: 1px solid var(--sov-line); box-shadow: var(--sov-shadow); cursor: pointer; text-align: left; font: inherit; color: inherit;
            transition: transform .15s, box-shadow .15s, background .2s, opacity .2s; overflow: hidden; }
.sov-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); opacity: .9; }
.sov-tile:hover { transform: translateY(-2px); }
.sov-tile .sov-tile-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--c);
                         background: color-mix(in srgb, var(--c) 14%, transparent); flex: 0 0 auto; }
.sov-tile .sov-tile-ic svg.sov-ic { width: 18px; height: 18px; }
.sov-tile strong { display: block; font-size: 1.55rem; line-height: 1; font-variant-numeric: tabular-nums; }
.sov-tile span.sov-tile-label { display: block; font-size: .75rem; color: var(--sov-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sov-tile.is-active { background: color-mix(in srgb, var(--c) 10%, var(--sov-surface)); box-shadow: 0 0 0 2px var(--c), var(--sov-shadow); }
.sov-tile.is-dim { opacity: .5; }
.sov-tile.is-zero strong { color: var(--sov-muted); }

/* Hoofdindeling */
.sov-body { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 14px; height: 680px; }
.sov:fullscreen .sov-body { flex: 1; height: auto; min-height: 0; }
.sov-side { display: flex; flex-direction: column; min-height: 0; background: var(--sov-surface); border: 1px solid var(--sov-line);
            border-radius: var(--sov-radius); box-shadow: var(--sov-shadow); overflow: hidden; }
.sov-side-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--sov-line);
                 font-size: .8rem; color: var(--sov-muted); }
.sov-side-head strong { color: var(--sov-text); font-size: .9rem; }
.sov-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }

/* Opdrachtkaart */
.sov-job { position: relative; padding: 12px 12px 10px 14px; border-radius: 12px; background: var(--sov-surface); border: 1px solid var(--sov-line);
           cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s, background .2s; animation: sov-in .25s ease-out both; }
.sov-job::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.sov-job:hover, .sov-job.is-hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--c) 55%, var(--sov-line)); box-shadow: var(--sov-shadow); }
.sov-job.is-selected { background: color-mix(in srgb, var(--c) 7%, var(--sov-surface)); border-color: var(--c); box-shadow: 0 0 0 1px var(--c), var(--sov-shadow); }
.sov-job-head { display: flex; align-items: center; gap: 10px; }
.sov-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 .75rem/1 system-ui, sans-serif; color: #fff;
              background: linear-gradient(135deg, color-mix(in srgb, var(--c) 85%, #000 0%), color-mix(in srgb, var(--c) 70%, #0f172a)); flex: 0 0 auto; }
.sov-job-title { min-width: 0; flex: 1; }
.sov-job-title strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sov-job-title span { display: block; font-size: .78rem; color: var(--sov-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sov-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .7rem; font-weight: 600; white-space: nowrap;
            color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.sov-pill svg.sov-ic { width: 11px; height: 11px; }
.sov-pill.is-alert { --c: var(--sov-problem); }
.sov-pill.is-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: sov-blink 1.4s infinite; }
.sov-job-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sov-seg { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--sov-line); margin: 10px 0 8px; gap: 2px; }
.sov-seg > i { display: block; height: 100%; transition: width .4s ease; }
.sov-job-stats { display: flex; gap: 14px; font-size: .76rem; color: var(--sov-muted); align-items: center; }
.sov-job-stats span { display: inline-flex; align-items: center; gap: 5px; }
.sov-job-stats .sov-time { margin-left: auto; }
.sov-monsters { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--sov-line); display: flex; flex-direction: column; gap: 2px; }
.sov-monster { display: flex; align-items: center; gap: 8px; font-size: .8rem; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.sov-monster:hover { background: color-mix(in srgb, var(--sov-opened) 8%, transparent); }
.sov-monster .sov-num { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .68rem; font-weight: 700; color: #fff; background: var(--c); }
.sov-monster em { margin-left: auto; font-style: normal; color: var(--sov-muted); font-variant-numeric: tabular-nums; }
.sov-empty { padding: 36px 16px; color: var(--sov-muted); text-align: center; font-size: .9rem; }
.sov-skeleton { height: 112px; border-radius: 12px; background: linear-gradient(90deg, var(--sov-line) 25%, var(--sov-surface-2) 50%, var(--sov-line) 75%);
                background-size: 200% 100%; animation: sov-shimmer 1.2s infinite; }

/* Kaart */
.sov-mapwrap { position: relative; border-radius: var(--sov-radius); overflow: hidden; border: 1px solid var(--sov-line); box-shadow: var(--sov-shadow); min-height: 0; }
.sov-map { position: absolute; inset: 0; background: #e5e9ef; }
.sov-glass { background: color-mix(in srgb, var(--sov-surface) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
             border: 1px solid color-mix(in srgb, var(--sov-line) 70%, transparent); border-radius: 12px; box-shadow: 0 6px 20px rgba(15, 23, 42, .12); }
.sov-mapbar { position: absolute; z-index: 500; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.sov-mapbar > * { pointer-events: auto; }
.sov-mapcard { padding: 8px 12px; font-size: .85rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sov-mapcard .sov-seg { width: 120px; margin: 0; }
.sov-mapbar .sov-spacer { flex: 1; pointer-events: none; }
.sov-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--sov-line);
           background: var(--sov-surface); color: var(--sov-text); font: inherit; font-size: .82rem; cursor: pointer; transition: transform .15s; }
.sov-btn:hover { transform: translateY(-1px); }
.sov-btn.is-primary { background: #0b2a55; border-color: #0b2a55; color: #fff; }
.sov-legend { position: absolute; z-index: 500; bottom: 14px; left: 12px; padding: 8px 12px; font-size: .74rem; display: flex; gap: 12px; flex-wrap: wrap; max-width: calc(100% - 90px); }
.sov-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--sov-muted); }
.sov-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.sov .leaflet-control-zoom { border: none; box-shadow: 0 6px 20px rgba(15, 23, 42, .12); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.sov .leaflet-control-zoom a { width: 34px; height: 34px; line-height: 34px; }

/* Markers */
.sov-jobmarker { position: relative; width: 52px; height: 52px; transition: transform .2s ease; }
.sov-jobmarker.is-hover { transform: scale(1.15); z-index: 1000; }
.sov-jobmarker svg { width: 52px; height: 52px; filter: drop-shadow(0 3px 6px rgba(15, 23, 42, .35)); }
.sov-jobmarker.is-live::before { content: ""; position: absolute; inset: 2px; border-radius: 50%; border: 3px solid var(--c); animation: sov-halo 2s ease-out infinite; }
.sov-jobmarker .sov-alert { position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--sov-problem, #ef4444);
                            color: #fff; font: 700 11px/18px system-ui, sans-serif; text-align: center; border: 2px solid #fff; }
.sov-joblabel { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 600 11px/1.2 system-ui, sans-serif;
                background: rgba(15, 23, 42, .88); color: #fff; padding: 3px 7px; border-radius: 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.sov-pin { position: relative; width: 30px; height: 40px; transition: transform .2s ease; transform-origin: 50% 100%; }
.sov-pin:hover, .sov-pin.is-hover { transform: scale(1.18); }
.sov-pin svg { width: 30px; height: 40px; filter: drop-shadow(0 3px 5px rgba(15, 23, 42, .35)); }
.sov-pin.sov-pulse::after { content: ""; position: absolute; left: 50%; top: 15px; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
                            border: 3px solid var(--sov-done, #10b981); animation: sov-halo 1.4s ease-out 4; }

/* Popup */
.sov-popup .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .22); padding: 0; }
.sov-popup .leaflet-popup-content { margin: 0; min-width: 230px; font: 13px/1.45 system-ui, sans-serif; }
.sov-pop { padding: 12px 14px; }
.sov-pop h4 { margin: 0 0 6px; font-size: .95rem; }
.sov-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 10px 0; font-size: .8rem; }
.sov-pop dt { color: #64748b; }
.sov-pop dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sov-pop .sov-seg { margin: 4px 0 0; }
.sov-pop .sov-btn { width: 100%; justify-content: center; }

@keyframes sov-live { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 100% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } }
@keyframes sov-halo { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes sov-blink { 50% { opacity: .25; } }
@keyframes sov-spin { to { transform: rotate(360deg); } }
@keyframes sov-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes sov-shimmer { to { background-position: -200% 0; } }
@keyframes sov-flash {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 0%, transparent); }
    30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 14%, var(--sov-surface)); }
}
@keyframes sov-bump { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14px) scale(1.15); } 55% { transform: translateY(0) scale(.96); } 75% { transform: translateY(-5px); } }
@keyframes sov-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--c); } 100% { transform: scale(1); } }
.sov-job.is-flash { animation: sov-flash 1.1s ease-in-out 3; }
.sov-jobmarker.is-bump { animation: sov-bump 1s ease-out 2; }
.sov-tile strong.is-pop { animation: sov-pop .7s ease-out; display: inline-block; }

/* Toastmeldingen (op elk tabblad zichtbaar) */
.sov-toasts { position: fixed; top: 76px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px));
              pointer-events: none; font-family: inherit; }
.sov-toast { --c: #3b82f6; position: relative; pointer-events: auto; display: flex; gap: 12px; padding: 12px 14px 14px; border-radius: 14px; cursor: pointer;
             background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #0f172a;
             border: 1px solid rgba(226, 232, 240, .9); box-shadow: 0 12px 32px rgba(15, 23, 42, .18); overflow: hidden;
             animation: sov-toast-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
[data-theme="dark"] .sov-toast { background: rgba(17, 24, 39, .9); color: #e5e7eb; border-color: rgba(31, 41, 55, .9); }
.sov-toast.is-leaving { animation: sov-toast-out .35s ease-in both; }
.sov-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.sov-toast-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--c); flex: 0 0 auto;
                background: color-mix(in srgb, var(--c) 15%, transparent); }
.sov-toast-ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sov-toast-body { min-width: 0; flex: 1; }
.sov-toast-body strong { display: block; font-size: .88rem; }
.sov-toast-body p { margin: 2px 0 0; font-size: .8rem; color: #64748b; }
.sov-toast-flow { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.sov-toast-flow .sov-pill { font-size: .68rem; }
.sov-toast-flow .sov-arrow { color: #94a3b8; font-size: .8rem; }
.sov-toast-close { position: absolute; top: 6px; right: 8px; border: 0; background: none; color: #94a3b8; cursor: pointer; font-size: 1rem; line-height: 1; }
.sov-toast-timer { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--c); opacity: .6; animation: sov-toast-timer linear forwards; }
.sov-toast:hover .sov-toast-timer { animation-play-state: paused; }
#sampling-badge.is-bounce { animation: sov-bump .9s ease-out 2; display: inline-block; }

/* Belletje met meldingen (bovenbalk) */
.sov-bellwrap[hidden], .sov-bell-panel[hidden], .sov-bell-count[hidden] { display: none !important; }
.sov-bellwrap { position: relative; display: inline-flex; margin-right: 6px; }
.sov-bell { position: relative; display: inline-grid; place-items: center; width: 40px; height: 36px; padding: 0; }
.sov-bell svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform-origin: 50% 10%; }
.sov-bell.is-ringing svg { animation: sov-ring 1s ease-in-out 2; }
.sov-bell.is-muted::after { content: ""; position: absolute; width: 22px; height: 2px; background: currentColor; transform: rotate(-45deg); opacity: .7; }
.sov-bell-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff;
                  font: 700 11px/18px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 2px var(--card, #fff); box-sizing: border-box; }
.sov-bell-count.is-pop { animation: sov-pop .6s ease-out; }
.sov-bell-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 10001; width: min(380px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column;
                  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #0f172a;
                  border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 18px 48px rgba(15, 23, 42, .22); overflow: hidden;
                  animation: sov-panel-in .22s cubic-bezier(.2, .9, .3, 1.1) both; text-align: left; }
[data-theme="dark"] .sov-bell-panel { background: rgba(17, 24, 39, .96); color: #e5e7eb; border-color: #1f2937; }
.sov-bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(148, 163, 184, .25); }
.sov-bell-head strong { font-size: .95rem; }
.sov-bell-head a { font-size: .78rem; color: #3b82f6; text-decoration: none; cursor: pointer; }
.sov-bell-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; font-size: .8rem; color: #64748b;
                  border-bottom: 1px solid rgba(148, 163, 184, .25); }
.sov-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.sov-switch input { position: absolute; opacity: 0; pointer-events: none; }
.sov-switch i { position: relative; width: 34px; height: 20px; border-radius: 10px; background: #cbd5e1; transition: background .2s; }
.sov-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.sov-switch input:checked + i { background: #10b981; }
.sov-switch input:checked + i::after { transform: translateX(14px); }
.sov-switch input:focus-visible + i { outline: 2px solid #3b82f6; outline-offset: 2px; }
.sov-bell-list { overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.sov-event { position: relative; display: flex; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.sov-event:hover { background: rgba(148, 163, 184, .14); }
.sov-event.is-unread::after { content: ""; position: absolute; top: 14px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; }
.sov-event .sov-toast-ic { width: 30px; height: 30px; border-radius: 9px; }
.sov-event-body { min-width: 0; flex: 1; padding-right: 14px; }
.sov-event-body strong { display: block; font-size: .84rem; }
.sov-event-body p { margin: 2px 0 0; font-size: .77rem; color: #64748b; }
.sov-event-body time { display: block; margin-top: 3px; font-size: .7rem; color: #94a3b8; }
.sov-event .sov-toast-flow { margin-top: 4px; }
.sov-bell-empty { padding: 32px 16px; text-align: center; color: #94a3b8; font-size: .85rem; }
@keyframes sov-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes sov-panel-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sov-toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sov-toast-out { to { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes sov-toast-timer { from { width: 100%; } to { width: 0; } }
@media (prefers-reduced-motion: reduce) {
    .sov *, .sov *::before, .sov *::after, .sov-toast, .sov-toast *, .sov-bell svg, .sov-bell-panel { animation: none !important; transition: none !important; }
}

@media (max-width: 1200px) { .sov-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
    .sov-body { grid-template-columns: 1fr; height: auto; }
    .sov-side { max-height: 360px; }
    .sov-mapwrap { height: 480px; }
    .sov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
