html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #f4f6f9;
}

.network-monitoring-shell {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.nm-app-header {
    height: 54px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.nm-app-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.nm-app-logo {
    width: 100px;
    height: 36px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
    flex-shrink: 0;
}

.nm-app-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.nm-app-title {
    font-size: 15px;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.1;
}

.nm-app-subtitle {
    font-size: 11px;
    color: #667085;
    margin-top: 2px;
}

.nm-app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.nm-app-nav-link {
    color: #475467;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.nm-app-nav-link:hover,
.nm-app-nav-link.active {
    background: #e8f3f1;
    color: #0f766e;
}

.nm-app-nav-link.has-unseen-alarms {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nm-alarm-nav-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
}

.nm-header-icon {
    position: relative;
}

.nm-alarm-header-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 9px;
    height: 9px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #dc2626;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.45);
    display: none;
}

.nm-header-icon.has-unseen-alarms .nm-alarm-header-dot {
    display: block;
}

.nm-app-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nm-app-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.nm-app-user-text span {
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.nm-app-user-text small {
    color: #667085;
    font-size: 10px;
    text-transform: uppercase;
}

.nm-app-logout {
    border: 1px solid #d0d5dd;
    color: #344054;
    background: #ffffff;
    text-decoration: none;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.nm-app-logout:hover {
    border-color: #0f766e;
    color: #0f766e;
}

.nm-language-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #f8fafc;
}

.nm-language-btn {
    min-width: 31px;
    height: 25px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #475467;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.nm-language-btn.active {
    background: #0f766e;
    color: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaaaaa;
}

.toast-container,
#toast_container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 13000 !important;
    pointer-events: none;
}

.toast {
    background: #333333;
    color: #ffffff;
    padding: 15px 25px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s forwards;
    pointer-events: all;
    min-width: 300px;
    font-size: 14px;
}

.toast.success {
    border-left: 5px solid #28a745;
}

.toast.error {
    border-left: 5px solid #dc3545;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Régi bootstrap-szerű gomb kompatibilitás */

.btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-primary,
.btn.primary {
    background: #007bff;
    color: #ffffff;
}

.btn-success,
.btn.success {
    background: #28a745;
    color: #ffffff;
}

.btn-danger,
.btn.danger {
    background: #dc3545;
    color: #ffffff;
}

.btn-secondary,
.btn.secondary {
    background: #6c757d;
    color: #ffffff;
}

.btn-warning,
.btn.warning {
    background: #ffc107;
    color: #333333;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    margin-right: 4px;
}

/* Közös modal alap a régi modal-overlay kompatibilitáshoz */

.modal-overlay,
.nm-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.open,
.nm-modal.open {
    display: flex;
}

.modal-content,
.nm-modal-box {
    background: #ffffff;
    width: 900px;
    max-width: 95%;
    height: auto;
    max-height: 95vh;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header,
.nm-modal-header {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 2px solid #eeeeee;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-footer,
.nm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #eeeeee;
    flex-shrink: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    flex-grow: 1;
}

.form-full {
    grid-column: span 3;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: #555555;
    font-size: 13px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
}

textarea.form-control {
    resize: none;
    height: 200px;
    min-height: 60px;
}

select,
select option {
    font-size: 14px;
}

@media (max-width: 900px) {
    .nm-app-header {
        height: auto;
        min-height: 54px;
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 10px;
    }

    .nm-app-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .nm-app-header-main {
        min-width: 170px;
    }
}

/* SmartBox-inspired application shell. */
:root {
    --nm-bg: #f3f6f7;
    --nm-surface: #ffffff;
    --nm-border: #e3e9ec;
    --nm-border-strong: #d5dee3;
    --nm-text: #15222f;
    --nm-heading: #0d1b2a;
    --nm-muted: #71808e;
    --nm-primary: #078c68;
    --nm-primary-dark: #057354;
    --nm-primary-soft: #eaf7f2;
    --nm-shadow: 0 1px 2px rgba(16,35,50,.03), 0 7px 22px rgba(16,35,50,.055);
    --nm-header-height: 68px;
    --nm-sidebar-width: 224px;
}

html, body { color: var(--nm-text); background: var(--nm-bg); font-family: "Inter", "Segoe UI Variable", "Segoe UI", Tahoma, sans-serif; }
.network-monitoring-shell { height: 100vh; display: grid; grid-template-columns: var(--nm-sidebar-width) minmax(0,1fr); grid-template-rows: var(--nm-header-height) minmax(0,1fr); grid-template-areas: "header header" "sidebar main"; background: var(--nm-bg); }
.network-monitoring-shell > :not(.nm-header):not(.nm-sidebar) { grid-area: main; min-width: 0; min-height: 0; overflow: auto; padding: 24px 28px 30px; background: radial-gradient(circle at 88% 4%, rgba(7,140,104,.035), transparent 24rem), var(--nm-bg); }
.nm-header { grid-area: header; display: grid; grid-template-columns: var(--nm-sidebar-width) minmax(240px,460px) minmax(300px,1fr); align-items: center; gap: 24px; padding: 0 20px 0 18px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--nm-border); box-shadow: 0 1px 7px rgba(16,35,50,.035); z-index: 50; }
.nm-brand { display: flex; align-items: center; gap: 11px; width: max-content; color: var(--nm-heading); text-decoration: none; }
.nm-brand img { width: 38px; height: 32px; object-fit: cover; object-position: left center; border-radius: 4px; }
.nm-brand span, .nm-brand strong, .nm-brand small { display: block; }
.nm-brand strong { font-size: 14px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.nm-brand small { color: var(--nm-muted); font-size: 11px; line-height: 1.2; font-weight: 600; }
.nm-header-search { height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 10px 0 12px; border: 1px solid var(--nm-border); border-radius: 9px; background: #fbfcfc; color: #8a97a2; text-align: left; cursor: pointer; }
.nm-header-search:hover { background: #fff; border-color: #c9d6db; box-shadow: 0 3px 12px rgba(16,35,50,.06); }
.nm-header-search svg { width: 16px; height: 16px; fill: #8796a1; }
.nm-header-search span { flex: 1; font-size: 12px; }
.nm-header-search kbd { min-width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #dde5e8; border-radius: 5px; background: #fff; color: #91a0aa; font-size: 10px; }
.nm-user { justify-self: end; display: flex; align-items: center; gap: 9px; min-width: 0; }
.nm-demo-session { position: fixed; right: 18px; bottom: 18px; z-index: 100; min-height: 32px; display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 5px 4px 11px; border: 1px solid #bfd8ff; border-radius: 999px; background: #edf5ff; color: #235ca8; box-shadow: 0 8px 24px rgba(31,92,165,.18); font-size: 9px; font-weight: 850; white-space: nowrap; }
.nm-demo-session::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2d75d4; box-shadow: 0 0 0 3px rgba(45,117,212,.12); }
.nm-demo-session button { min-height: 19px; padding: 0 7px; border: 0; border-radius: 999px; background: #fff; color: #235ca8; font: inherit; cursor: pointer; }
.nm-demo-session button:hover { background: #dbeaff; }
.nm-user-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #cadbd5; border-radius: 50%; background: linear-gradient(145deg,#dcebe6,#f0f6f4); color: var(--nm-primary-dark); font-size: 12px; font-weight: 900; }
.nm-user-avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.nm-user-profile-link{display:flex;align-items:center;gap:9px;min-width:0;color:inherit;text-decoration:none}.nm-user-profile-link:hover .nm-app-user-text strong{color:var(--nm-primary-dark)}
.nm-app-user-text { display: block; min-width: 0; line-height: 1.1; }
.nm-app-user-text strong, .nm-app-user-text small { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-app-user-text strong { color: var(--nm-heading); font-size: 11px; }
.nm-app-user-text small { margin-top: 2px; color: var(--nm-muted); font-size: 9px; }
.nm-header-icon,.nm-app-logout { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 8px; color: #62727f; text-decoration:none; }
.nm-header-icon:hover,.nm-app-logout:hover { background: var(--nm-primary-soft); border-color: transparent; color: var(--nm-primary); }
.nm-header-icon svg,.nm-app-logout svg { width: 17px; height: 17px; fill: currentColor; }
.nm-language-switch { padding: 2px; border-color: var(--nm-border); border-radius: 8px; background: #f8faf9; }
.nm-language-btn { min-width: 28px; height: 25px; padding: 4px 6px; border-radius: 6px; color: #7d8b96; font-size: 9px; }
.nm-language-btn.active { background: #fff; color: var(--nm-primary-dark); box-shadow: 0 1px 4px rgba(16,35,50,.12); }
.nm-sidebar { grid-area: sidebar; min-height: 0; display: flex; flex-direction: column; padding: 20px 14px 16px; background: #fff; border-right: 1px solid var(--nm-border); overflow: hidden; z-index: 10; }
.nm-sidebar-label { padding: 0 11px 9px; color: #a0abb3; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.nm-app-nav { display: flex; flex: 1; min-height: 0; flex-direction: column; align-items: stretch; gap: 4px; overflow: auto; }
.nm-app-nav-link { min-height: 40px; display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 8px; color: #52626f; font-size: 12px; font-weight: 650; transition: background .14s,color .14s,transform .14s; }
.nm-app-nav-link:hover { background: #f4f8f7; color: var(--nm-heading); transform: translateX(1px); }
.nm-app-nav-link.active { background: var(--nm-primary-soft); color: var(--nm-primary-dark); font-weight: 800; }
.nm-nav-icon { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; color: #788791; }
.nm-nav-icon svg { width: 17px; height: 17px; fill: currentColor; }
.nm-app-nav-link.active .nm-nav-icon { color: var(--nm-primary); }
.nm-sidebar-foot { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 12px 10px 2px; border-top: 1px solid #edf1f2; min-width: 0; }
.nm-sidebar-foot > span { width: 8px; height: 8px; border-radius: 50%; background: #18a66f; box-shadow: 0 0 0 4px #e9f8f1; }
.nm-sidebar-foot div { min-width: 0; }
.nm-sidebar-foot strong, .nm-sidebar-foot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-sidebar-foot strong { color: #40515e; font-size: 10px; }
.nm-sidebar-foot small { margin-top: 1px; color: #929da5; font-size: 8px; }

/* Consistent page surfaces and controls across legacy screens. */
.network-monitoring-shell section, .network-monitoring-shell .panel-box, .network-monitoring-shell .chart-container, .network-monitoring-shell .ipam-table-card, .network-monitoring-shell .settings-card { border-color: var(--nm-border); box-shadow: var(--nm-shadow); }
.network-monitoring-shell h1, .network-monitoring-shell h2, .network-monitoring-shell h3, .network-monitoring-shell h4 { color: var(--nm-heading); letter-spacing: -.015em; }
.network-monitoring-shell input:focus, .network-monitoring-shell select:focus, .network-monitoring-shell textarea:focus { outline: 0; border-color: rgba(7,140,104,.65); box-shadow: 0 0 0 3px rgba(7,140,104,.11); }
.btn-primary, .btn.primary, .settings-btn.primary { background: var(--nm-primary); color: #fff; }
.btn-primary:hover, .btn.primary:hover, .settings-btn.primary:hover { background: var(--nm-primary-dark); }

@media (max-width: 1180px) {
    :root { --nm-sidebar-width: 204px; }
    .nm-header { grid-template-columns: var(--nm-sidebar-width) minmax(200px,360px) 1fr; gap: 16px; }
    .nm-app-user-text { display: none; }
    .network-monitoring-shell > :not(.nm-header):not(.nm-sidebar) { padding: 22px; }
}
@media (max-width: 860px) {
    body { overflow: auto; }
    .network-monitoring-shell { height: auto; min-height: 100vh; grid-template-columns: 1fr; grid-template-rows: 64px auto minmax(calc(100vh - 120px),auto); grid-template-areas: "header" "sidebar" "main"; }
    .nm-header { grid-template-columns: auto minmax(150px,1fr) auto; height: 64px; padding: 0 14px; gap: 12px; position: sticky; top: 0; }
    .nm-demo-session { right: 10px; bottom: 10px; }
    .nm-brand span { display: none; }
    .nm-sidebar { padding: 7px 10px; border-right: 0; border-bottom: 1px solid var(--nm-border); position: sticky; top: 64px; overflow: auto; }
    .nm-sidebar-label, .nm-sidebar-foot { display: none; }
    .nm-app-nav { flex-direction: row; overflow: visible; min-width: max-content; }
    .nm-app-nav-link { min-height: 36px; padding: 7px 10px; }
    .network-monitoring-shell > :not(.nm-header):not(.nm-sidebar) { padding: 18px; overflow: visible; }
}
@media (max-width: 580px) {
    .network-monitoring-shell { grid-template-rows: auto auto minmax(calc(100vh - 160px),auto); }
    .nm-header { height: auto; min-height: 64px; grid-template-columns: auto 1fr; padding: 9px 12px; gap: 8px; }
    .nm-header-search { grid-column: 1/-1; grid-row: 2; width: 100%; height: 36px; }
    .nm-user { justify-self: end; }
    .nm-user-avatar, .nm-app-logout { display: none; }
    .nm-sidebar { top: 109px; }
    .nm-app-nav-link > span:last-child { display: none; }
    .network-monitoring-shell > :not(.nm-header):not(.nm-sidebar) { padding: 14px 12px 22px; }
}

/* Location registry action menu. */
.locations-action-cell{width:56px;text-align:right;overflow:visible!important}.locations-id{margin-top:2px;color:var(--nm-muted);font-size:8px}.locations-row-menu-trigger{width:30px;height:30px;display:grid;place-items:center;margin-left:auto;border:1px solid var(--nm-border);border-radius:8px;background:#fff;color:#5c6b76;font-size:18px;cursor:pointer}.locations-row-menu-trigger:hover,.locations-row-menu-trigger.active{border-color:#add7ca;background:var(--nm-primary-soft);color:var(--nm-primary-dark)}.locations-action-menu{position:fixed;z-index:90;min-width:190px;padding:5px;border:1px solid var(--nm-border);border-radius:9px;background:#fff;box-shadow:0 12px 32px rgba(16,35,50,.18)}.locations-action-menu button{width:100%;min-height:34px;display:flex;align-items:center;border:0;border-radius:6px;background:transparent;padding:7px 10px;color:#425361;font-size:10px;font-weight:750;text-align:left;cursor:pointer}.locations-action-menu button:hover{background:var(--nm-primary-soft);color:var(--nm-primary-dark)}.locations-action-menu button.danger{color:#c63f48}.locations-action-menu button:disabled{opacity:.45;cursor:not-allowed}.network-monitoring-shell .locations-page{padding:0;background:transparent}.network-monitoring-shell .locations-head{margin:0 0 2px;padding:0 0 4px}.network-monitoring-shell .locations-card{border-top:1px solid var(--nm-border)}
