    :root {
        --sp-yellow: #f5c400;
        --sp-yellow-soft: #fff3bf;
        --sp-yellow-dark: #d6a200;
        --sp-black: #1f1f1f;
        --sp-black-soft: #2b2b2b;
        --bg: #f8f9fa;
        --surface: #ffffff;
        --border: #e0e0e0;
        --text: #242424;
        --text-muted: #605e5c;
        --shadow: 0 2px 8px rgba(0, 0, 0, .08);
        --header-height: 48px;
        --footer-height: 28px;
    }

    body {
        margin: 0;
        background: var(--bg);
        font-size: 13px;
        overflow: hidden;
    }

    dialog {
        border: none;
        background: var(--surface);
        width: 800px;
        max-width: 95vw;
        max-height: 90vh;
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        flex-direction: column;
        overflow: hidden;

    }

    /* ===== MÓDOSÍTOTT LAYOUT: Nincs bal oszlop ===== */
    .appShell {
        display: grid;
        grid-template-columns: 1fr;
        /* Csak egy oszlop */
        grid-template-rows: var(--header-height) 1fr var(--footer-height);
        height: 100vh;
        font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
        color: var(--text);
    }

    /* ===== Top bar (Navigációval bővítve) ===== */
    .topBar {
        /* grid-column: 1/-1; már nem szükséges, mivel csak 1 oszlop van, de maradhat */
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 0 16px;
        background: linear-gradient(90deg, var(--sp-black), #000000);
        color: #fff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, .15);
        z-index: 10;
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
        font-size: 15px;
        white-space: nowrap;
        margin-right: 20px;
        /* Kis térköz a menü előtt */
    }

    .brandDot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--sp-yellow);
        box-shadow: 0 0 0 2px rgba(255, 255, 255, .2);
    }

    /* ===== ÚJ FELSŐ NAVIGÁCIÓ STÍLUSOK ===== */
    .topNav {
        display: flex;
        height: 100%;
        gap: 5px;
        flex: 1;
        /* Kitölti a rendelkezésre álló helyet */
        overflow-x: auto;
        /* Ha túl sok menüpont lenne */
    }

    .navItem {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px;
        cursor: pointer;
        color: rgba(255, 255, 255, 0.7);
        transition: all .2s ease;
        font-size: 13px;
        border-bottom: 3px solid transparent;
        height: 100%;
        box-sizing: border-box;
        white-space: nowrap;
        text-decoration: none;
    }

    .navItem:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    /* Aktív állapot felülírása a vízszintes menühöz */
    .navItem.active {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        font-weight: 600;
        border-bottom-color: var(--sp-yellow);
        /* Alsó sárga csík */
        border-left: none;
        /* Régi bal oldali csík eltávolítása */
    }

    .navItem i {
        font-size: 14px;
    }

    /* ===== Content Area ===== */
    .content {
        /* grid-row: 2/3; automatikus */
        background: #f0f2f5;
        padding: 24px;
        /* Kicsit nagyobb padding, mivel szélesebb lett */
        overflow: auto;
        position: relative;
        max-width: 1600px;
        /* Hogy ne folyjon szét túl széles monitoron */
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }

    .page-section {
        display: none;
        animation: fadeIn 0.2s ease-in-out;
    }

    .page-section.visible {
        display: block;
    }

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

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

    .pageTitle {
        font-size: 18px;
        font-weight: 600;
        margin: 0 0 12px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* ===== Cards & Tables ===== */
    .card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 16px;
        box-shadow: var(--shadow);
        margin-bottom: 16px;
    }

    .data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

    .data-table th {
        text-align: left;
        padding: 8px 12px;
        background: #faf9f8;
        border-bottom: 2px solid var(--border);
        font-weight: 600;
        color: var(--text-muted);
    }

    .data-table td {
        padding: 8px 12px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .data-table tr:hover {
        background-color: #f8f9fa;
    }

    /* Status badges */
    .badge {
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        display: inline-block;
    }

    .badge-green {
        background: #e6ffcc;
        color: #107c10;
    }

    .badge-blue {
        background: #cceeff;
        color: #005a9e;
    }

    .badge-gray {
        background: #f3f2f1;
        color: #605e5c;
    }

    .badge-red {
        background: #fde7e9;
        color: #a80000;
    }

    /* ===== Parent-Child & User Groups ===== */
    .toggle-icon {
        display: inline-block;
        transition: transform 0.2s ease;
        cursor: pointer;
        width: 20px;
        text-align: center;
        color: var(--text-muted);
    }

    .toggle-icon.expanded {
        transform: rotate(90deg);
        color: var(--sp-yellow);
    }

    .detail-row {
        display: none;
        background-color: #faf9f8;
    }

    .detail-row.visible {
        display: table-row;
    }

    .inner-table {
        width: 100%;
        font-size: 12px;
        border: 1px solid #e1e1e1;
        background: white;
        margin: 5px 0 15px 0;
    }

    .inner-table th {
        background: #f3f2f1;
        padding: 6px;
        border-bottom: 1px solid #ddd;
    }

    .inner-table td {
        padding: 6px;
        border-bottom: 1px solid #eee;
    }

    .group-row {
        cursor: pointer;
    }

    .group-row.selected {
        background-color: var(--sp-yellow-soft) !important;
        border-left: 3px solid var(--sp-yellow);
    }

    .user-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
        margin-top: 15px;
    }

    .user-box {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 12px;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: box-shadow 0.2s;
    }

    .user-box:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-color: #ccc;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        background: #e1e1e1;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: 600;
        color: #555;
    }

    /* ===== MFA Kiegészítés ===== */

    .mfa-container {
        max-width: 400px;
        margin: 40px auto;
        text-align: center;
    }

    .digit-inputs {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin: 20px 0;
    }

    .digit-input {
        width: 45px;
        height: 55px;
        font-size: 24px;
        text-align: center;
        border: 1px solid var(--border);
        border-radius: 6px;
        font-weight: bold;
        background: white;
    }

    .digit-input:focus {
        border-color: var(--sp-yellow);
        outline: 2px solid var(--sp-yellow-soft);
    }

    .qr-placeholder {
        width: 180px;
        height: 180px;
        background: #fff;
        border: 1px solid var(--border);
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        position: relative;
        background-image: radial-gradient(#333 30%, transparent 31%), radial-gradient(#333 30%, transparent 31%);
        background-size: 10px 10px;
        background-position: 0 0, 5px 5px;
        opacity: 0.8;
    }

    .qr-placeholder::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 40px;
        height: 40px;
        background: white;
        border: 4px solid var(--sp-yellow);
        border-radius: 4px;
    }

    .step-list {
        text-align: left;
        margin: 20px 0;
    }

    .step-item {
        display: flex;
        gap: 10px;
        margin-bottom: 12px;
    }

    .step-number {
        background: var(--sp-black);
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 12px;
        font-weight: bold;
        flex-shrink: 0;
    }

    /* ===== Footer ===== */
    .footer {
        /* grid-column: 1/-1; */
        background: var(--sp-black-soft);
        color: #bbb;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
        font-size: 11px;
        border-top: 1px solid #333;
    }

    /* ===== Modal ===== */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 1000;
        display: none;
        justify-content: center;
        align-items: center;
    }

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

    .modal-box {
        background: var(--surface);
        width: 800px;
        max-width: 95vw;
        max-height: 90vh;
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .modal-header {
        padding: 12px 20px;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #faf9f8;
    }

    .modal-body {
        padding: 20px;
        overflow-y: auto;
        background: #fff;
    }

    .modal-footer {
        padding: 12px 20px;
        border-top: 1px solid var(--border);
        background: #faf9f8;
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }

    .form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .form-group label {
        display: block;
        margin-bottom: 4px;
        font-weight: 500;
        font-size: 12px;
        color: var(--text-muted);
    }

    .form-group input,
    .form-group select {
        width: 100%;
        padding: 6px 8px;
        border: 1px solid var(--border);
        border-radius: 4px;
        font-size: 13px;
        box-sizing: border-box;
    }

    .tabs {
        display: flex;
        border-bottom: 1px solid var(--border);
        margin-bottom: 15px;
    }

    .tab {
        padding: 8px 16px;
        cursor: pointer;
        border-bottom: 2px solid transparent;
        color: var(--text-muted);
    }

    .tab.active {
        border-bottom-color: var(--sp-yellow);
        color: var(--sp-black);
        font-weight: 600;
    }

    .btn {
        border: 1px solid var(--border);
        /* background: white; */
        padding: 6px 14px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
    }

    .btn:hover {
        background: #f3f2f1;
    }

    .btn-primary {
        background: var(--sp-yellow);
        border-color: #e0b400;
        color: #000;
    }

    .btn-primary:hover {
        background: #ffd84d;
    }

    .btn-icon {
        padding: 4px 8px;
        border: none;
        background: transparent;
        cursor: pointer;
    }

    .btn-icon:hover {
        background: #eee;
    }

    /* ===== Login Overlay ===== */
    .login-screen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease-out, visibility 0.3s;
    }

    .login-screen.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .login-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 40px;
        width: 100%;
        max-width: 380px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
        text-align: center;
    }

    .tabs {
        display: flex;
        border-bottom: 1px solid var(--border);
        margin-bottom: 15px;
    }

    .tab {
        padding: 8px 16px;
        cursor: pointer;
        border-bottom: 2px solid transparent;
        color: var(--text-muted);
    }

    .tab.active {
        border-bottom-color: var(--sp-yellow);
        color: var(--sp-black);
        font-weight: 600;
    }

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.8);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.loading-icon {
    font-size: 3rem;
    color: var(--sp-yellow-dark, #d6a200);
    animation: hourglass-spin 1.5s infinite ease-in-out;
}

@keyframes hourglass-spin {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(180deg); }
}

.loading-text {
    margin-top: 15px;
    color: var(--text-muted, #605e5c);
}