/* RadarSeam - boje su u MudBlazor temi (RadarTheme.cs, samo tamna); ovde su samo okviri koje MudBlazor nema
   (prijava, kockice za kod, ucitavanje, trake dostupnosti). */
html, body { height: 100%; margin: 0; font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif; background: #070C1C; color: #E6EAF5; }

/* Ucitavanje aplikacije */
#app-preloader { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: #070C1C; }
.app-preloader-box { position: relative; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
.app-preloader-box img { width: 44px; height: 44px; object-fit: contain; }
.app-preloader-spinner { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(59, 130, 246, .18); border-top-color: #3B82F6; animation: app-preloader-spin .8s linear infinite; }
@keyframes app-preloader-spin { to { transform: rotate(360deg); } }

.rs-center { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px; }

/* Javne strane naloga (prijava, zaboravljena i nova lozinka): dvodelna kartica - levo brend, desno forma. */
.rs-auth-page {
    min-height: 100vh; min-height: 100svh;
    display: flex; align-items: center; justify-content: center;
    background-color: #070C1C;
    background-image:
        radial-gradient(900px circle at 12% 8%, rgba(59, 130, 246, 0.16), transparent 55%),
        radial-gradient(900px circle at 88% 92%, rgba(45, 212, 191, 0.10), transparent 55%);
    padding: 16px;
}
.rs-login-shell { width: 100%; max-width: 980px; min-height: 600px; background: var(--mud-palette-surface, #0E1630); border-radius: 24px; border: 1px solid var(--mud-palette-lines-default, #1C2847); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45); display: flex; overflow: hidden; }
.rs-login-brand {
    flex: 0 0 44%; position: relative; overflow: hidden; padding: 40px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    background: linear-gradient(160deg, #0A1430 0%, #0A1430 30%, var(--mud-palette-primary) 170%);
}
.rs-login-form { flex: 1 1 auto; padding: 56px 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.rs-login-mobile-logo { display: none; justify-content: center; align-items: center; gap: 10px; margin-bottom: 28px; }
@media (max-width: 760px) {
    .rs-login-shell { min-height: 0; border-radius: 20px; }
    .rs-login-brand { display: none; }
    .rs-login-form { padding: 32px 24px; }
    .rs-login-mobile-logo { display: flex; }
    .rs-login-form .rs-heading, .rs-login-form .rs-heading + .mud-typography { text-align: center; }
}
.rs-powered-by { font-size: .72rem; font-weight: 500; color: var(--mud-palette-text-disabled, #56607D); text-align: center; letter-spacing: .02em; }
.rs-legal-link { color: inherit; text-decoration: underline; }
.rs-big-btn { height: 52px; border-radius: 14px !important; font-weight: 700 !important; letter-spacing: .04em; }

/* Zamucena pozadina iza dijaloga. */
.mud-overlay-scrim { background-color: rgba(3, 6, 15, 0.6) !important; backdrop-filter: blur(7px) !important; -webkit-backdrop-filter: blur(7px) !important; }

/* Kockice za 6-cifreni kod */
.fm-otp { display: flex; gap: 10px; justify-content: center; }
.fm-otp-box {
    width: 52px; height: 62px; text-align: center; font-size: 26px; font-weight: 800;
    border: 2px solid rgba(255, 255, 255, .18); border-radius: 14px;
    background: rgba(255, 255, 255, .05); color: var(--mud-palette-text-primary);
    font-family: inherit; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.fm-otp-box:hover { border-color: rgba(96, 165, 250, .6); }
.fm-otp-box:focus { outline: none; border-color: var(--mud-palette-primary); box-shadow: 0 0 0 4px rgba(59, 130, 246, .2); }
.fm-otp-box.is-filled { border-color: var(--mud-palette-primary); background: rgba(59, 130, 246, .1); }
.fm-otp-box:disabled { opacity: .6; }
@media (max-width: 380px) { .fm-otp-box { width: 44px; height: 54px; font-size: 22px; } }

/* Tabele: zaglavlje izdvojeno bojom. */
.mud-table-head .mud-table-cell { background-color: var(--mud-palette-background-gray); font-weight: 700; color: var(--mud-palette-text-primary); }
.mud-table-container { border-radius: 12px; overflow: hidden; border: 1px solid var(--mud-palette-lines-default); }
@media (max-width: 959px) { .mud-table-container { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; } }

/* Traka dostupnosti po danima (pregled, monitor). Na telefonu poslednjih 30 dana. */
.rs-bars { display: flex; gap: 2px; height: 30px; align-items: stretch; }
.rs-bars > .mud-tooltip-root { flex: 1; display: flex; }
.rs-bars .rs-bar { flex: 1; border-radius: 3px; min-width: 2px; transition: transform .15s, filter .15s; }
.rs-bars .rs-bar:hover { transform: scaleY(1.12); filter: brightness(1.25); }
@media (max-width: 640px) { .rs-bars.rs-bars-90 > .mud-tooltip-root:nth-child(-n+60) { display: none; } }

/* Tacka stanja koja "kuca" kad ne radi. */
.rs-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.rs-dot.rs-pulse { animation: rs-pulse 1.6s ease-out infinite; }
@keyframes rs-pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); } 100% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } }

/* Telefon: meni klizi preko stranice, zaglavlje zbijenije. */
@media (max-width: 599px) {
    .mud-drawer.mud-drawer-mini { display: none; }
    .mud-layout .mud-main-content { margin-left: 0 !important; }
    .mud-layout .mud-appbar { left: 0 !important; width: 100% !important; margin-left: 0 !important; }
    .mud-appbar .mud-toolbar { padding-left: 8px; padding-right: 4px; gap: 0; }
    .mud-appbar .mud-icon-button { padding: 8px; }
    .mud-appbar .rs-user-name { display: none !important; }
    .mud-main-content .mud-typography-h4 { font-size: 1.65rem; line-height: 1.2; }
    .mud-main-content .mud-typography-h5 { font-size: 1.3rem; }
    .mud-main-content .mud-button-root { max-width: 100%; }
    .mud-main-content .mud-button-label { white-space: normal; text-align: center; }
    .mud-dialog { max-width: calc(100vw - 16px) !important; margin: 8px !important; }
    html, body { overflow-x: clip; }
}

h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }

#blazor-error-ui { position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: #3b2a06; color: #fff; z-index: 2000; box-shadow: 0 -1px 4px rgba(0, 0, 0, .4); }
#blazor-error-ui[hidden] { display: none; }
#blazor-error-ui .reload { margin-left: 8px; color: #fff; }

/* Stampa (izvestaj dostupnosti): bez menija i traka, svetla pozadina, tamna slova. */
@media print {
    .mud-appbar, .mud-drawer, .rs-no-print, #rs-update, .mud-snackbar-provider { display: none !important; }
    .mud-main-content { margin: 0 !important; padding: 0 !important; }
    html, body, .mud-layout, .mud-main-content, .mud-paper { background: #fff !important; color: #111 !important; box-shadow: none !important; }
    .mud-paper { border: 1px solid #ccc !important; break-inside: avoid; }
    .mud-typography, .mud-text-secondary { color: #222 !important; }
}

/* Centar za nadzor (pocetna): okvir sa mrezom, paneli, radar koji se okrece. */
.rs-mission { position: relative; border: 1px solid var(--mud-palette-lines-default); border-radius: 22px; padding: 14px;
    background-color: #0A0F24;
    background-image: linear-gradient(rgba(96, 165, 250, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(96, 165, 250, .045) 1px, transparent 1px);
    background-size: 28px 28px; }
.rs-panel { border: 1px solid #1E2A4F; border-radius: 16px; background: rgba(12, 18, 44, .88); padding: 14px 16px; height: 100%; }
.rs-panel-title { display: flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: #C9D2EC; margin-bottom: 10px; }
.rs-panel-title .rs-right { margin-left: auto; font-family: Consolas, monospace; letter-spacing: .02em; font-size: .8rem; color: #E6EAF5; }
.rs-kpi { border: 1px solid #1E2A4F; border-left-width: 3px; border-radius: 12px; background: rgba(12, 18, 44, .88); padding: 12px 14px; height: 100%; }
.rs-kpi b { display: block; font-family: Consolas, 'Courier New', monospace; font-size: 2.1rem; line-height: 1; font-weight: 800; }
.rs-kpi span { display: block; margin-top: 8px; font-size: .66rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #9AA6C8; }
.rs-clock { font-family: Consolas, 'Courier New', monospace; font-weight: 800; line-height: 1; font-size: clamp(2.4rem, 4.2vw, 4rem); letter-spacing: .02em; }
.rs-clock small { font-size: .5em; color: #9AA6C8; }
.rs-radar { position: relative; flex: none; width: 116px; height: 116px; border-radius: 50%; border: 2px solid rgba(96, 165, 250, .25);
    background: radial-gradient(circle, transparent 30%, rgba(96, 165, 250, .08) 31%, transparent 32%, transparent 62%, rgba(96, 165, 250, .08) 63%, transparent 64%); overflow: hidden; }
.rs-radar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg, transparent 290deg, var(--rs-sweep, rgba(45, 212, 191, .55)) 360deg); animation: rs-sweep 3s linear infinite; }
.rs-radar .rs-radar-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
@keyframes rs-sweep { to { transform: rotate(360deg); } }
.rs-status-word { font-family: Manrope, Inter, sans-serif; font-weight: 900; text-transform: uppercase; line-height: 1.02; font-size: clamp(1.6rem, 2.6vw, 2.6rem); overflow-wrap: anywhere; }
.rs-check-row { display: grid; grid-template-columns: 14px minmax(0, 1.6fr) minmax(0, 1fr) 70px 80px; gap: 10px; align-items: center; padding: 7px 4px; border-top: 1px solid #172246; font-size: .85rem; cursor: pointer; }
.rs-check-row:hover { background: rgba(96, 165, 250, .05); }
/* Boja reda po stanju provere: zelena radi, zuta upozorenje, crvena ne radi, siva ceka/pauza (ivica levo + blaga pozadina). */
.rs-check-row:not(.rs-check-head) { border-left: 3px solid transparent; border-radius: 0 8px 8px 0; }
.rs-check-up { border-left-color: var(--mud-palette-success) !important; background: rgba(34, 197, 94, .06); }
.rs-check-degraded { border-left-color: var(--mud-palette-warning) !important; background: rgba(245, 158, 11, .10); }
.rs-check-down { border-left-color: var(--mud-palette-error) !important; background: rgba(239, 68, 68, .12); }
.rs-check-up:hover { background: rgba(34, 197, 94, .11); }
.rs-check-degraded:hover { background: rgba(245, 158, 11, .16); }
.rs-check-down:hover { background: rgba(239, 68, 68, .18); }
.rs-check-chip { flex: none; font-size: .6rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 1px 7px; border: 1px solid; border-radius: 999px; line-height: 1.5; opacity: .9; }
.rs-check-head { font-size: .62rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #7D89AE; border-top: 0; cursor: default; }
.rs-check-head:hover { background: transparent; }
.rs-mono { font-family: Consolas, 'Courier New', monospace; }
.rs-matrix { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; }
.rs-matrix span { height: 12px; border-radius: 2px; }
@media (max-width: 900px) { .rs-check-row { grid-template-columns: 14px minmax(0, 1fr) 70px; } .rs-check-row .rs-hide-sm { display: none; } }

/* Raspored centra za nadzor: redovi kao CSS grid (na uzem ekranu jedno ispod drugog). */
.rs-mission > .rs-row + .rs-row { margin-top: 12px; }
.rs-row { display: grid; gap: 12px; min-height: 0; }
.rs-row-top { grid-template-columns: minmax(0, 4fr) minmax(0, 2fr) minmax(0, 6fr); }
.rs-row-mid { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.rs-row-bot { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); }
.rs-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; height: 100%; }
.rs-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.rs-side > .rs-panel { height: auto; }
.rs-panel { display: flex; flex-direction: column; min-height: 0; }
.rs-panel-body { flex: 1; min-height: 0; }
.rs-more { font-size: .7rem; color: #7D89AE; text-align: center; padding-top: 4px; letter-spacing: .1em; }
@media (max-width: 1200px) {
    .rs-mission:not(.rs-tv) .rs-row-top, .rs-mission:not(.rs-tv) .rs-row-mid, .rs-mission:not(.rs-tv) .rs-row-bot { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) { .rs-mission:not(.rs-tv) .rs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Prikaz za TV: tacno jedan ekran, bez skrola - redovi dele visinu, liste se skrate (+N jos). */
html.rs-tv-on, html.rs-tv-on body { overflow: hidden !important; }
.rs-mission.rs-tv { height: calc(100vh - 24px); height: calc(100dvh - 24px); display: grid; gap: 12px; overflow: hidden;
    grid-template-rows: auto minmax(118px, 17%) minmax(0, 1fr) minmax(0, 25%) auto; }
.rs-mission.rs-tv > .rs-row + .rs-row { margin-top: 0; }
.rs-mission.rs-tv .rs-panel, .rs-mission.rs-tv .rs-side { height: 100%; overflow: hidden; }
.rs-mission.rs-tv .rs-side > .rs-panel { flex: 1; height: auto; }
.rs-mission.rs-tv .rs-panel-body { overflow: hidden; }
.rs-mission.rs-tv .rs-radar { width: min(116px, 13vh); height: min(116px, 13vh); }
.rs-mission.rs-tv .rs-kpi b { font-size: clamp(1.3rem, 3.2vh, 2.1rem); }
.rs-mission.rs-tv .rs-kpi { padding: 8px 12px; }
.rs-mission.rs-tv .rs-check-row { padding: 4px 4px; }
.rs-mission.rs-tv .rs-panel { padding: 10px 14px; }
.rs-mission.rs-tv .rs-panel-title { margin-bottom: 6px; }
.rs-mission.rs-tv .rs-clock { font-size: clamp(2rem, 5.6vh, 4rem); }
.rs-mission.rs-tv .rs-kpi { overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.rs-mission.rs-tv .rs-kpi span { margin-top: 4px; font-size: clamp(.52rem, 1.15vh, .66rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-mission.rs-tv .rs-side > .rs-panel:first-child { flex: 1.4; }
.rs-mission.rs-tv .rs-status-word { font-size: clamp(1.3rem, 3.6vh, 2.6rem); }

/* Prozor kriticnog alarma */
.rs-alarm { width: min(600px, calc(100vw - 32px)); border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, #1A0D18 0%, #0E1430 38%); border: 1px solid rgba(239, 68, 68, .75);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, .10), 0 0 90px rgba(239, 68, 68, .40); animation: rs-alarm-in .25s ease-out; }
@keyframes rs-alarm-in { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.rs-alarm-stripe { height: 10px; background: repeating-linear-gradient(135deg, #EF4444 0 16px, #1A0B10 16px 32px); background-size: 45px 45px; animation: rs-stripe 1s linear infinite; }
@keyframes rs-stripe { to { background-position: 45px 0; } }
.rs-alarm-body { padding: 18px 26px 22px; }
.rs-alarm-tag { font-family: Consolas, monospace; font-size: .7rem; font-weight: 800; letter-spacing: .14em; padding: 4px 10px; border-radius: 999px; background: #EF4444; color: #fff; }
.rs-alarm-tag-ghost { background: transparent; border: 1px solid #5B6587; color: #9AA6C8; margin-right: 10px; }
.rs-alarm-live { display: inline-flex; align-items: center; gap: 8px; font-size: .7rem; font-weight: 800; letter-spacing: .22em; color: #F87171; }
.rs-alarm-live i { width: 9px; height: 9px; border-radius: 50%; background: #EF4444; animation: rs-blink 1s steps(2, start) infinite; }
@keyframes rs-blink { to { visibility: hidden; } }
.rs-alarm-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 14px 0 18px; }
.rs-alarm-icon { width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, #EF4444 0 58%, rgba(239, 68, 68, .18) 59% 100%);
    animation: rs-pulse-big 1.6s ease-out infinite; margin-bottom: 16px; }
@keyframes rs-pulse-big { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 100% { box-shadow: 0 0 0 26px rgba(239, 68, 68, 0); } }
.rs-alarm-icon .mud-icon-root { font-size: 46px; color: #fff; }
.rs-alarm-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: #F87171; }
.rs-alarm-title { margin-top: 6px; font-family: Manrope, Inter, sans-serif; font-weight: 900; text-transform: uppercase; line-height: 1.05; font-size: clamp(1.7rem, 4.4vw, 2.6rem); overflow-wrap: anywhere; color: #F1F4FB; }
.rs-alarm-sub { margin-top: 6px; font-family: Consolas, monospace; font-size: .85rem; letter-spacing: .12em; color: #9AA6C8; }
.rs-alarm-cause { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(239, 68, 68, .09); border: 1px solid rgba(239, 68, 68, .28); border-left: 4px solid #EF4444; color: #FCA5A5; font-size: .95rem; line-height: 1.45; }
.rs-alarm-cause .mud-icon-root { color: #EF4444; margin-top: 2px; flex: none; }
.rs-alarm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; }
.rs-alarm-stats div { border: 1px solid #1E2A4F; border-radius: 12px; background: rgba(12, 18, 44, .9); padding: 9px 12px; text-align: center; }
.rs-alarm-stats span { display: block; font-size: .6rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #7D89AE; }
.rs-alarm-stats b { display: block; margin-top: 4px; font-family: Consolas, monospace; font-size: 1.15rem; color: #E6EAF5; }
.rs-alarm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rs-alarm-foot { padding: 0 0 14px; text-align: center; font-size: .72rem; color: #7D89AE; }
.rs-alarm-foot > span { display: block; padding: 10px 26px 0; }
.rs-alarm-foot b { color: #E6EAF5; font-family: Consolas, monospace; font-weight: 700; }
.rs-alarm-timer { height: 3px; background: rgba(239, 68, 68, .12); overflow: hidden; }
.rs-alarm-timer div { height: 100%; width: 100%; background: linear-gradient(90deg, #EF4444, #F97316); transform-origin: left; animation: rs-drain linear forwards; }
@keyframes rs-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.rs-alarm-stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Vodic "kako se koristi" (rsTour u rs.js): zatamnjen ekran, osvetljen element, oblacic sa koracima. */
.rs-tour { position: fixed; inset: 0; z-index: 1500; }
.rs-tour-block { position: fixed; inset: 0; }
.rs-tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(3, 8, 24, .72), 0 0 0 3px #fff inset; pointer-events: none;
    transition: left .25s, top .25s, width .25s, height .25s; }
.rs-tour-bubble { position: fixed; width: min(380px, calc(100vw - 16px)); padding: 16px 18px 14px; border-radius: 16px; background: #F3F6FF; color: #111827;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5); font-family: inherit; transition: left .25s, top .25s; }
.rs-tour-bubble::after { content: ""; position: absolute; left: calc(var(--rs-arrow-x, 50%) - 9px); bottom: -9px; width: 18px; height: 18px; background: #F3F6FF;
    transform: rotate(45deg); border-radius: 3px; }
.rs-tour-bubble.is-below::after { bottom: auto; top: -9px; }
.rs-tour-step { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #2563EB; margin-bottom: 4px; }
.rs-tour-title { font-size: 1.08rem; font-weight: 800; margin-bottom: 4px; }
.rs-tour-text { font-size: .9rem; line-height: 1.45; color: #3F4A63; }
.rs-tour-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.rs-tour-actions button { border: none; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700; border-radius: 10px; padding: 8px 14px; white-space: nowrap; }
.rs-tour-next { background: #2563EB; color: #fff; }
.rs-tour-next:hover { background: #1D4ED8; }
.rs-tour-back { background: #DCE6FF; color: #1D4ED8; }
.rs-tour-skip { background: transparent; color: #6B7280; padding: 8px 4px !important; }
.rs-tour-skip:hover { color: #111827; }
