:root {
    --ink: #17212b;
    --navy: #17324d;
    --navy-dark: #10263b;
    --steel: #637586;
    --paper: #f3f1eb;
    --panel: #ffffff;
    --line: #d6d9dc;
    --accent: #d87824;
    --success: #2f7656;
    --danger: #a33a34;
}

html, body { min-height: 100%; }
body {
    color: var(--ink);
    background: var(--paper);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Header — hi-tech */
.app-navbar {
    position: relative;
    min-height: 76px;
    padding-block: .45rem;
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(32, 92, 140, .55) 0%, transparent 55%),
        linear-gradient(90deg, #07111c 0%, #0c1e31 55%, #091827 100%);
    box-shadow: inset 0 -1px 0 rgba(76, 201, 240, .22), 0 6px 22px rgba(4, 12, 22, .35);
    z-index: 1040;
}
.navbar-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.navbar-fx::before {
    content: ""; position: absolute; inset: -40px;
    background-image: linear-gradient(rgba(76, 201, 240, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(76, 201, 240, .08) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .4) 55%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .4) 55%, transparent 100%);
    animation: hdrGrid 20s linear infinite;
}
.navbar-fx::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(76, 201, 240, .7) 30%, #d87824 50%, rgba(76, 201, 240, .7) 70%, transparent 100%);
    background-size: 200% 100%;
    animation: hdrLine 7s linear infinite;
}
.navbar-scan {
    position: absolute; top: 0; bottom: 0; left: 0; width: 260px;
    background: linear-gradient(90deg, transparent, rgba(76, 201, 240, .10), transparent);
    transform: translateX(-280px);
    animation: hdrScan 10s ease-in-out infinite;
}
@keyframes hdrGrid { to { transform: translate(40px, 40px); } }
@keyframes hdrLine { from { background-position: 200% 0; } to { background-position: 0 0; } }
@keyframes hdrScan { 0% { transform: translateX(-280px); } 55%, 100% { transform: translateX(100vw); } }
.app-navbar > .container-fluid { position: relative; z-index: 1; }

.navbar-brand { display: inline-flex; align-items: center; gap: .8rem; height: 58px; margin: 0; padding: 0; }
.navbar-brand img { display: block; width: auto; height: 48px; filter: drop-shadow(0 0 10px rgba(76, 201, 240, .22)); }
.brand-radar {
    position: relative; flex: 0 0 42px; width: 42px; height: 42px; overflow: hidden; border-radius: 50%;
    border: 1px solid rgba(76, 201, 240, .6);
    background:
        linear-gradient(rgba(76, 201, 240, .25), rgba(76, 201, 240, .25)) center / 100% 1px no-repeat,
        linear-gradient(rgba(76, 201, 240, .25), rgba(76, 201, 240, .25)) center / 1px 100% no-repeat,
        repeating-radial-gradient(circle, transparent 0 6px, rgba(76, 201, 240, .22) 6px 7px),
        #06121d;
    box-shadow: 0 0 14px rgba(76, 201, 240, .25), inset 0 0 12px rgba(76, 201, 240, .2);
}
.radar-sweep {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg 280deg, rgba(76, 201, 240, .7) 360deg);
    animation: radarSweep 3s linear infinite;
}
.radar-dot {
    position: absolute; top: 10px; left: 26px; width: 6px; height: 6px; border-radius: 50%;
    background: #ff9a3c; box-shadow: 0 0 8px #ff9a3c;
    animation: radarBlip 3s ease-out infinite;
}
@keyframes radarSweep { to { transform: rotate(360deg); } }
@keyframes radarBlip { 0%, 5% { opacity: .15; transform: scale(.6); } 10% { opacity: 1; transform: scale(1.4); } 100% { opacity: .15; transform: scale(.7); } }

.navbar-toggler { border-color: rgba(76, 201, 240, .5); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(76, 201, 240, .25); }
.navbar-toggler-icon { filter: invert(1); }
.app-navbar .nav-link {
    position: relative; margin-inline: .1rem; padding: .55rem .95rem !important; border-radius: 8px;
    color: rgba(226, 236, 245, .72); font-size: .88rem; font-weight: 600; letter-spacing: .03em;
    transition: color .2s ease, background-color .2s ease;
}
.app-navbar .nav-link::after {
    content: ""; position: absolute; left: .95rem; right: .95rem; bottom: .15rem; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, #4cc9f0, #d87824); box-shadow: 0 0 8px rgba(76, 201, 240, .6);
    transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.app-navbar .nav-link:hover, .app-navbar .nav-link:focus { color: #fff; background: rgba(76, 201, 240, .08); }
.app-navbar .nav-link:hover::after { transform: scaleX(.5); }
.app-navbar .nav-link.active { color: #fff; background: rgba(76, 201, 240, .12); }
.app-navbar .nav-link.active::after { transform: scaleX(1); }

.sys-status {
    display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem; border-radius: 999px;
    border: 1px solid rgba(64, 214, 140, .35); background: rgba(64, 214, 140, .08);
    color: #7ee2b0; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.sys-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #40d68c; }
.sys-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #40d68c; animation: sysPulse 1.8s ease-out infinite; }
@keyframes sysPulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3.2); opacity: 0; } }
.sys-clock {
    color: #bfe9f7; font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: .95rem; letter-spacing: .08em;
    font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(76, 201, 240, .45);
}
.user-chip { display: inline-flex; align-items: center; gap: .5rem; }
.user-avatar {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #4cc9f0, #1f6f9a); color: #06121d; font-size: .85rem; font-weight: 800;
    box-shadow: 0 0 0 2px rgba(76, 201, 240, .25);
}
.user-name { color: #dce6ef; font-size: .84rem; font-weight: 600; }
.btn-logout {
    display: inline-flex; align-items: center; gap: .4rem; border: 1px solid rgba(255, 255, 255, .22); border-radius: 8px;
    color: #dce6ef; background: rgba(255, 255, 255, .04);
}
.btn-logout:hover, .btn-logout:focus { color: #fff; border-color: #d87824; background: rgba(216, 120, 36, .2); }
@media (max-width: 1399.98px) { .sys-clock { display: none; } }
@media (min-width: 992px) and (max-width: 1199.98px) {
    .user-name, .btn-logout span { display: none; }
    .sys-status { gap: 0; padding: .45rem; font-size: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .navbar-fx::before, .navbar-fx::after, .navbar-scan, .radar-sweep, .radar-dot, .sys-pulse::after { animation: none; }
}

.page-shell { padding: 1.5rem; }
.page-heading { margin-bottom: 1.25rem; }
.eyebrow { color: var(--steel); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.page-title { margin: .15rem 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.page-subtitle { color: var(--steel); margin: .3rem 0 0; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 3px 12px rgba(23,33,43,.07);
}
.panel-header { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); background: #fafafa; }
.panel-body { padding: 1.1rem; }
.app-alert { margin: 1rem 1.5rem 0; }

.btn { border-radius: 3px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy-dark); --bs-btn-hover-border-color: var(--navy-dark); }
.btn-accent { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { color: #fff; background: #bd641a; border-color: #bd641a; }
.form-control, .form-select { border-radius: 3px; border-color: #bdc4ca; }
.form-control:focus, .form-select:focus { border-color: #607e99; box-shadow: 0 0 0 .2rem rgba(23,50,77,.14); }
.form-label { color: #354554; font-size: .83rem; font-weight: 700; }

.table { margin: 0; font-size: .91rem; }
.table thead th { color: #f5f7f9; background: var(--navy); border-color: #294967; white-space: nowrap; font-size: .76rem; letter-spacing: .045em; text-transform: uppercase; }
.table td { vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: #f7f8f8; }
.status-dot { display: inline-block; width: .62rem; height: .62rem; margin-right: .4rem; border-radius: 50%; background: var(--steel); }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(47,118,86,.13); }
.status-dot.offline { background: var(--danger); }
.status-badge { display: inline-flex; align-items: center; padding: .28rem .5rem; border: 1px solid currentColor; border-radius: 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; }

.map-page { height: calc(100vh - 76px); min-height: 520px; position: relative; overflow: hidden; }
#map { width: 100%; height: 100%; background: #d7dde0; }
.map-toolbar {
    position: absolute; inset: 1rem auto auto 1rem; z-index: 800;
    width: min(360px, calc(100% - 2rem)); padding: .85rem;
    background: rgba(255,255,255,.96); border: 1px solid #bfc6cc; border-top: 4px solid var(--accent);
    box-shadow: 0 4px 18px rgba(23,33,43,.2);
}
.map-status { font-size: .8rem; color: var(--steel); }
.map-legend { display: flex; gap: 1rem; margin-top: .55rem; font-size: .76rem; color: #455563; }
.vehicle-marker { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 2px 7px rgba(0,0,0,.42); font-size: .72rem; font-weight: 800; }
.vehicle-marker.moving { background: var(--danger); }
.vehicle-marker.parked { background: var(--success); }
.legend-swatch { display: inline-block; width: .65rem; height: .65rem; margin-right: .25rem; border-radius: 50%; }
.legend-swatch.moving { background: var(--danger); }
.legend-swatch.parked { background: var(--success); }
.legend-swatch.slow { background: #e8901f; }
.legend-swatch.offline { background: #8a96a1; }
.map-legend { flex-wrap: wrap; gap: .45rem .9rem; }
.map-legend b { margin-left: .15rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Markeri vozila */
.car-marker-wrap { background: none; border: 0; }
.car-marker { position: relative; width: 42px; height: 36px; display: grid; place-items: center; --car: #e03b2f; }
.car-marker.status-moving { --car: #e03b2f; }
.car-marker.status-slow { --car: #e8901f; }
.car-marker.status-parked { --car: #2f9a68; }
.car-marker.status-offline { --car: #8a96a1; opacity: .8; }
.car-body { position: relative; color: var(--car); line-height: 0; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
.car-marker.status-moving::before {
    content: ""; position: absolute; inset: -4px 0; border-radius: 50%;
    background: radial-gradient(circle, rgba(224,59,47,.35) 0%, rgba(224,59,47,0) 70%);
    animation: carPulse 1.8s ease-out infinite;
}
@keyframes carPulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.car-popup-wrap .leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: 0 10px 30px rgba(16,38,59,.3); }
.car-popup-wrap .leaflet-popup-content { margin: .8rem .9rem; }
.car-popup-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .45rem; }
.car-popup-head small { display: block; color: var(--steel); }
.car-popup-number { display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 800; }
.car-popup-status { display: inline-block; margin-bottom: .45rem; padding: .12rem .5rem; border-radius: 999px; color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.car-popup-status.status-moving { background: #e03b2f; } .car-popup-status.status-slow { background: #e8901f; } .car-popup-status.status-parked { background: #2f9a68; } .car-popup-status.status-offline { background: #8a96a1; }
.car-popup-address { display: flex; gap: .5rem; align-items: flex-start; margin: .1rem 0 .55rem; padding: .5rem .6rem; border-radius: 8px; background: #eef4f8; border-left: 3px solid #4cc9f0; font-size: .84rem; line-height: 1.3; }
.car-popup-address strong { display: block; color: var(--ink); }
.car-popup-address small { display: block; color: var(--steel); }
.car-popup-address .addr-pin { color: #1f7fb0; font-size: 1rem; line-height: 1.1; }
.car-popup-address.is-loading { color: var(--steel); }
.car-popup-address.is-loading .addr-pin { animation: addrSpin 1s linear infinite; display: inline-block; }
.car-popup-address.is-error { color: var(--steel); border-left-color: #8a96a1; }
@keyframes addrSpin { to { transform: rotate(360deg); } }
.car-popup dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .7rem; margin: 0; font-size: .82rem; }
.car-popup dt { color: var(--steel); font-weight: 600; }
.car-popup dd { margin: 0; }
@media (prefers-reduced-motion: reduce) { .car-marker.status-moving::before { animation: none; } }

.route-controls { position: absolute; z-index: 800; inset: auto 1rem 1rem 1rem; padding: .9rem; }
.route-controls form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .6fr) auto; gap: .75rem; align-items: end; }
.route-summary { position: absolute; z-index: 800; top: 1rem; left: 1rem; padding: .65rem .8rem; }

/* Login — hi-tech */
.login-page {
    min-height: 100vh; margin: 0; color: #dce6ef; overflow-x: hidden;
    background:
        radial-gradient(60% 70% at 18% 30%, rgba(30, 96, 150, .45) 0%, transparent 70%),
        radial-gradient(50% 60% at 90% 90%, rgba(216, 120, 36, .14) 0%, transparent 70%),
        linear-gradient(135deg, #050d16 0%, #0a1a2b 55%, #07121e 100%);
}
.login-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.login-grid {
    position: absolute; inset: -60px;
    background-image: linear-gradient(rgba(76, 201, 240, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(76, 201, 240, .07) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 45%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 85%);
    mask-image: radial-gradient(ellipse at 30% 45%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 85%);
    animation: loginGrid 30s linear infinite;
}
.login-scan {
    position: absolute; left: 0; right: 0; top: 0; height: 180px;
    background: linear-gradient(180deg, transparent, rgba(76, 201, 240, .06), transparent);
    animation: loginScan 9s ease-in-out infinite;
}
@keyframes loginGrid { to { transform: translate(60px, 60px); } }
@keyframes loginScan { 0% { transform: translateY(-200px); } 70%, 100% { transform: translateY(110vh); } }

.login-shell {
    position: relative; z-index: 1; min-height: 100vh; width: min(1180px, 100%); margin: 0 auto; padding: 2rem 1.25rem;
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px); align-items: center; gap: clamp(2rem, 6vw, 5rem);
}

.login-hero { position: relative; display: grid; justify-items: start; gap: 2rem; }
.hero-radar {
    position: relative; width: min(380px, 70vw); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
    border: 1px solid rgba(76, 201, 240, .45);
    background:
        linear-gradient(rgba(76, 201, 240, .18), rgba(76, 201, 240, .18)) center / 100% 1px no-repeat,
        linear-gradient(rgba(76, 201, 240, .18), rgba(76, 201, 240, .18)) center / 1px 100% no-repeat,
        repeating-radial-gradient(circle, transparent 0 15.5%, rgba(76, 201, 240, .2) 15.5% 16%),
        radial-gradient(circle, rgba(13, 46, 72, .9) 0%, rgba(5, 16, 27, .95) 70%);
    box-shadow: 0 0 60px rgba(76, 201, 240, .18), inset 0 0 50px rgba(76, 201, 240, .12);
}
.hero-sweep {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg 300deg, rgba(76, 201, 240, .08) 320deg, rgba(76, 201, 240, .55) 360deg);
    animation: radarSweep 4s linear infinite;
}
.hero-blip { position: absolute; inset: 0; transform: rotate(var(--a)) translateY(calc(var(--r) * -1)); }
.hero-blip::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
    background: #4cc9f0; box-shadow: 0 0 10px #4cc9f0, 0 0 22px rgba(76, 201, 240, .6);
    animation: heroBlip 4s ease-out infinite; animation-delay: var(--delay);
}
.hero-blip.is-accent::after { background: #ff9a3c; box-shadow: 0 0 10px #ff9a3c, 0 0 22px rgba(255, 154, 60, .6); }
@keyframes heroBlip { 0% { opacity: 1; transform: scale(1.5); } 70% { opacity: .2; transform: scale(.9); } 100% { opacity: .15; transform: scale(.8); } }
.hero-center { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #e8f7fd; box-shadow: 0 0 0 4px rgba(76, 201, 240, .25), 0 0 18px #4cc9f0; }

.hero-copy h2 { margin: .6rem 0 .5rem; color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1; }
.hero-copy p { max-width: 440px; margin: 0; color: rgba(220, 230, 239, .72); font-size: 1rem; }
.hero-kicker { display: inline-flex; align-items: center; gap: .55rem; color: #7ee2b0; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hero-features { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.hero-features li {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: 999px;
    border: 1px solid rgba(76, 201, 240, .28); background: rgba(76, 201, 240, .06); color: #cfe6f2; font-size: .82rem; font-weight: 600;
}
.hero-features li span { color: #4cc9f0; }
.hero-coords { color: rgba(191, 233, 247, .55); font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: .8rem; letter-spacing: .1em; font-variant-numeric: tabular-nums; }

.login-card {
    position: relative; padding: 2.25rem 2rem 1.75rem; border-radius: 18px;
    border: 1px solid rgba(76, 201, 240, .22);
    background: linear-gradient(160deg, rgba(20, 44, 68, .78), rgba(8, 20, 33, .86));
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.login-card::before {
    content: ""; position: absolute; left: 2rem; right: 2rem; top: -1px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, #4cc9f0, #d87824, transparent);
    box-shadow: 0 0 14px rgba(76, 201, 240, .6);
}
.login-logo { display: block; width: auto; height: 46px; max-width: 100%; margin: 0 0 1.6rem; filter: drop-shadow(0 0 12px rgba(76, 201, 240, .25)); }
.login-head { margin-bottom: 1.4rem; }
.login-kicker { color: #4cc9f0; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.login-title { margin: .35rem 0 .3rem; color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 1.75rem; }
.login-note { margin: 0; color: rgba(220, 230, 239, .65); font-size: .88rem; }
.login-error { margin-bottom: 1rem; padding: .7rem .9rem; border: 1px solid rgba(255, 107, 96, .45); border-radius: 10px; background: rgba(163, 58, 52, .22); color: #ffc7c1; font-size: .88rem; }
.login-label { display: block; margin: 0 0 .4rem; color: #b9cbd9; font-size: .8rem; font-weight: 700; letter-spacing: .03em; }
.login-field {
    position: relative; display: flex; align-items: center; margin-bottom: 1.1rem; border-radius: 10px;
    border: 1px solid rgba(160, 190, 215, .25); background: rgba(3, 10, 18, .55);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.login-field:focus-within { border-color: #4cc9f0; box-shadow: 0 0 0 3px rgba(76, 201, 240, .18), 0 0 18px rgba(76, 201, 240, .15); }
.login-field > svg { flex: 0 0 18px; width: 18px; height: 18px; margin-left: .9rem; }
.login-field svg, .login-secure svg, .login-submit svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-field > svg { color: #6f8fa8; }
.login-field:focus-within > svg { color: #4cc9f0; }
.login-field input {
    flex: 1; min-width: 0; padding: .85rem .9rem; border: 0; outline: 0; background: transparent; color: #fff; font-size: 1rem;
}
.login-field input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 1000px #07131f inset; caret-color: #fff; }
.login-eye { display: grid; place-items: center; width: 42px; height: 42px; margin-right: .2rem; border: 0; border-radius: 8px; background: transparent; color: #6f8fa8; }
.login-eye svg { width: 18px; height: 18px; }
.login-eye:hover, .login-eye[aria-pressed="true"] { color: #4cc9f0; background: rgba(76, 201, 240, .08); }
.login-submit {
    display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; margin-top: .4rem; padding: .9rem 1rem;
    border: 0; border-radius: 10px; color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .03em;
    background: linear-gradient(90deg, #1f7fb0, #2a9fd0 45%, #d87824 140%); background-size: 160% 100%;
    box-shadow: 0 10px 28px rgba(31, 127, 176, .35);
    transition: background-position .35s ease, transform .15s ease, box-shadow .2s ease;
}
.login-submit svg { width: 18px; height: 18px; transition: transform .2s ease; }
.login-submit:hover { background-position: 100% 0; box-shadow: 0 12px 32px rgba(216, 120, 36, .35); }
.login-submit:hover svg { transform: translateX(4px); }
.login-submit:active { transform: translateY(1px); }
.login-submit:focus-visible { outline: 2px solid #4cc9f0; outline-offset: 3px; }
.login-secure { display: flex; align-items: center; justify-content: center; gap: .45rem; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid rgba(160, 190, 215, .14); color: rgba(185, 203, 217, .6); font-size: .76rem; }
.login-secure svg { width: 14px; height: 14px; color: #7ee2b0; }

@media (max-width: 991.98px) {
    .login-shell { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .login-hero { position: fixed; inset: 0; z-index: -1; display: grid; place-items: center; opacity: .28; }
    .hero-copy, .hero-coords { display: none; }
    .hero-radar { width: min(560px, 120vw); }
    .login-card { width: min(440px, 100%); }
}
@media (max-width: 420px) { .login-card { padding: 1.75rem 1.25rem 1.4rem; } }
@media (prefers-reduced-motion: reduce) {
    .login-grid, .login-scan, .hero-sweep, .hero-blip::after { animation: none; }
}

.editable-input { min-width: 110px; border: 1px solid transparent; background: transparent; padding: .35rem .45rem; }
.editable-input:hover, .editable-input:focus { border-color: #b9c2ca; background: #fff; outline: none; }
.save-state { min-width: 72px; font-size: .74rem; color: var(--steel); }
.device-color { width: 46px; height: 34px; padding: .15rem; border: 1px solid #bcc4cb; border-radius: 3px; }
.empty-state { padding: 3.5rem 1rem; text-align: center; color: var(--steel); }
.devices-table-wrap { width: 100%; overflow: hidden; }
.devices-table { width: 100%; table-layout: fixed; }
.devices-table th, .devices-table td { padding: .45rem .35rem; overflow-wrap: anywhere; }
.devices-table th:first-child, .devices-table td:first-child { width: 8%; }
.devices-table th:nth-child(6), .devices-table td:nth-child(6) { width: 5%; }
.devices-table th:nth-child(9), .devices-table td:nth-child(9) { width: 4.5%; text-align: center; }
.devices-table th:nth-child(11), .devices-table td:nth-child(11) { width: 6%; }
.devices-table th:last-child, .devices-table td:last-child { width: 10%; }
.devices-table code { display: block; overflow: hidden; color: var(--navy); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.devices-table .editable-input { width: 100%; min-width: 0; }
.device-actions { white-space: normal; }
.device-actions .btn { margin: .1rem; }
.app-support {
    display: grid;
    gap: 2px;
    width: max-content;
    max-width: calc(100% - 1.5rem);
    margin: 1rem 1.5rem 1.25rem;
    padding: 6px 8px 5px;
    color: #52606c;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(23, 50, 77, .16);
    border-radius: 3px;
    box-shadow: 0 2px 7px rgba(16, 38, 59, .12);
    font-size: 10px;
    line-height: 1.3;
}
.app-support-fixed {
    position: fixed;
    left: 7px;
    bottom: 7px;
    z-index: 1100;
    margin: 0;
}
.login-card .app-support { margin: 1.5rem auto 0; }
.app-support .support-title { color: var(--navy); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.app-support > a { color: #354554; font-size: 11px; text-decoration: none; }
.app-support > a span { display: inline-block; width: 14px; color: var(--accent); text-align: center; }
.app-support a:hover, .app-support a:focus { color: var(--navy); text-decoration: underline; }
.support-copyright { margin-top: 2px; padding-top: 3px; border-top: 1px solid rgba(23, 50, 77, .12); font-size: 9px; }
.support-copyright a { color: inherit; text-decoration: none; }

.manual-badge { display: inline-block; margin-top: .25rem; padding: .12rem .45rem; border: 1px dashed var(--accent); border-radius: 999px; color: #a85a17; background: rgba(216,120,36,.08); font-size: .68rem; font-weight: 700; white-space: nowrap; }
.devices-table td[data-label="Device ID"] .manual-badge { display: block; width: max-content; }

/* Komunikacija */
.comm-filters { display: grid; grid-template-columns: 160px 160px minmax(220px, 1fr) 200px auto; gap: .75rem; align-items: end; }
.comm-filter-actions { display: flex; gap: .25rem; }
.comm-presets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.comm-preset { padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 999px; color: #354554; font-size: .8rem; font-weight: 600; text-decoration: none; background: #fafafa; }
.comm-preset:hover { border-color: var(--navy); color: var(--navy); }
.comm-preset.active { color: #fff; background: var(--navy); border-color: var(--navy); }
.comm-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.comm-stat { padding: .85rem 1rem; border-top: 4px solid var(--navy); }
.comm-stat.is-accepted { border-top-color: var(--success); }
.comm-stat.is-rejected { border-top-color: var(--danger); }
.comm-stat.is-timeout { border-top-color: #8a96a1; }
.comm-stat-label { color: var(--steel); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.comm-stat-value { margin: .1rem 0 .35rem; font-size: 1.75rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.comm-stat-note { color: var(--steel); font-size: .8rem; }
.comm-bar { display: flex; width: 100%; min-width: 90px; height: 8px; overflow: hidden; border-radius: 4px; background: #e6e9ec; }
.comm-bar span { display: block; height: 100%; }
.comm-bar-accepted { background: var(--success); }
.comm-bar-rejected { background: var(--danger); }
.comm-bar-timeout { background: #9aa5af; }
.comm-bar-pending { background: var(--accent); }
.comm-bar-cell { width: 22%; min-width: 110px; }
.comm-analysis td, .comm-analysis th { font-variant-numeric: tabular-nums; }
.comm-analysis a { color: var(--navy); font-weight: 600; text-decoration: none; }
.comm-analysis a:hover { text-decoration: underline; }
.comm-scroll { max-height: 420px; overflow-y: auto; }
.comm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; color: var(--steel); font-size: .78rem; }
.comm-dot { display: inline-block; width: .6rem; height: .6rem; margin-left: .45rem; border-radius: 50%; }
.comm-dot.accepted { background: var(--success); } .comm-dot.rejected { background: var(--danger); } .comm-dot.timeout { background: #9aa5af; } .comm-dot.pending { background: var(--accent); }
.comm-message { min-width: 260px; max-width: 520px; }
.comm-message strong { display: block; }
.comm-message span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #455563; font-size: .86rem; }
.comm-status { display: inline-block; padding: .22rem .5rem; border-radius: 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; border: 1px solid currentColor; }
.comm-status.accepted { color: var(--success); background: rgba(47,118,86,.08); }
.comm-status.rejected { color: var(--danger); background: rgba(163,58,52,.08); }
.comm-status.timeout { color: #5f6b76; background: rgba(95,107,118,.08); }
.comm-status.pending { color: #b0601b; background: rgba(216,120,36,.1); }
.comm-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--line); font-size: .85rem; }
@media (max-width: 1199.98px) {
    .comm-filters { grid-template-columns: 1fr 1fr; }
    .comm-filters > div:nth-child(3) { grid-column: 1 / -1; }
    .comm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .comm-stats > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 991.98px) {
    .app-navbar .navbar-collapse { padding-top: .75rem; }
    .app-navbar .nav-link { border-bottom: 0; border-left: 3px solid transparent; }
    .app-navbar .nav-link.active { border-left-color: var(--accent); background: rgba(76,201,240,.1); }
    .app-navbar .nav-link::after { display: none; }
    .app-navbar .nav-link { border-radius: 0; }
    .user-area { padding: .65rem .9rem .2rem; }
}
@media (max-width: 1599.98px) {
    .devices-table-wrap { padding: .75rem; background: #eef0f1; }
    .devices-table, .devices-table tbody { display: block; }
    .devices-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .devices-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .devices-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: 4px; background: #fff; box-shadow: 0 2px 7px rgba(23,33,43,.07); overflow: hidden; }
    .devices-table tbody td, .devices-table tbody td:first-child, .devices-table tbody td:nth-child(6), .devices-table tbody td:nth-child(9), .devices-table tbody td:nth-child(11), .devices-table tbody td:last-child { display: grid; grid-template-columns: minmax(88px, .8fr) minmax(0, 1.2fr); align-items: center; width: auto; min-height: 46px; padding: .35rem .55rem; border: 0; border-bottom: 1px solid #e5e7e9; text-align: left; }
    .devices-table tbody td::before { content: attr(data-label); padding-right: .5rem; color: var(--steel); font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .devices-table tbody td:first-child, .devices-table tbody td:nth-child(10), .devices-table tbody td:last-child { grid-column: 1 / -1; }
    .devices-table tbody td:last-child { border-bottom: 0; }
    .devices-table .device-color { width: 100%; }
    .devices-table .empty-state { display: block; grid-column: 1 / -1; }
    .devices-table .empty-state::before { content: none; }
}
@media (max-width: 767.98px) {
    .page-shell { padding: 1rem .75rem; }
    .app-alert { margin-inline: .75rem; }
    .navbar-brand { height: 52px; gap: .55rem; max-width: calc(100% - 64px); }
    .navbar-brand img { height: 38px; max-width: calc(100% - 42px); object-fit: contain; }
    .brand-radar { flex-basis: 34px; width: 34px; height: 34px; }
    .radar-dot { top: 8px; left: 21px; }
    .map-page { height: calc(100vh - 76px); min-height: 560px; }
    .route-controls form { grid-template-columns: 1fr; }
    .route-controls { inset-inline: .5rem; bottom: .5rem; }
    .route-summary { top: .5rem; left: .5rem; right: .5rem; }
    .table { font-size: .84rem; }
    .devices-table tbody { grid-template-columns: 1fr; }
    .devices-table tbody tr { grid-template-columns: 1fr; }
    .devices-table tbody td, .devices-table tbody td:first-child, .devices-table tbody td:nth-child(6), .devices-table tbody td:nth-child(9), .devices-table tbody td:nth-child(10), .devices-table tbody td:nth-child(11), .devices-table tbody td:last-child { grid-column: 1; grid-template-columns: minmax(105px, .75fr) minmax(0, 1.25fr); }
    .app-support:not(.app-support-fixed) { margin-inline: .75rem; }
    .login-card .app-support { margin-inline: auto; }
}
